[PATCH] shell/lash.c: set environment variable

Rob Landley rob at landley.net
Fri May 12 21:34:05 UTC 2006


On Friday 12 May 2006 4:49 pm, Shaun Jackman wrote:
> On 5/12/06, Rob Landley <rob at landley.net> wrote:
> > > On 4/21/06, Shaun Jackman <sjackman at gmail.com> wrote:
> > > > This patch allows setting an environment variable without an explicit
> > > > `export' statement. I understand there's a moratorium of features on
> > > > lash, but I consider 'foo=bar' a fairly basic and necessary syntax.
> > > > On my ARM7 system this patch adds 32 bytes to the .text section.
> >
> > Hmmm...  If adding anything at all to lash is reasonable, this probably
> > would be.  It supports "this=that" as a statement, which would ordinarily
> > set a shell internal variable except lash doesn't have any.  It doesn't
> > support "this=that command"...
> >
> > I'm trying to figure out if it is.  Lash is already a funky custom
> > environment to program against...
> >
> > Very definitely on the fence here...
>
> As it sits, you'll have to disregard this patch. This feature should
> have been implemented before the fork in run_command, and not in
> pseudo_exec.

Ok.

> For an exported variable, such as PATH, `this=that' does have the
> correct semantics with this patch. In fact, since lash does not have
> shell-local variables, it makes sense, in a way, that all variables
> should act as though they were exported.

Sure.

> I broke my wrist yesterday, which makes typing laborious. I will not
> provide an updated patch here, but you can expect one in three to six
> weeks.

Ouch.  Get well soon.

> Cheers,
> Shaun

One big reason I'm on the fence about this is I want to do all this _right_ 
with bbsh.  Unfortunately, since I went to day job land it's a lot harder to 
find time to work on the "ok, I'm going to disappear for 2 weeks now" type 
projects than it is to grab half an hour here and two hours there.  And 
unfortunately, getting bbsh from where it is to ready to check in is 
definitely a "see you in 2 weeks" type of project.  (I try doing marathon 
sessions over weekends, but that leaves me exhausted and listless during the 
work week...)

I'll figure something out...

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list