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

Shaun Jackman sjackman at gmail.com
Fri May 12 20:49:15 UTC 2006


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.

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.

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.

Cheers,
Shaun


More information about the busybox mailing list