This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: About ENV?
Andrew DeFaria <Andrew@DeFaria.com> wrote:
> It doesn't. If "This syntax is useful for setting environment
> variables for one command invocation only" then the echo command
> should have echoed "aaa". Otherwise the syntax is not useful for
> setting environment variables for one command invocation. Perhaps
> what is meant is that this syntax is useful for overriding
> environment variables for one command invocation? However this leaves
> a glaring inconsistancy prone to error if the variable was not set
> already then no override takes place.
Its all quite logical really - when bash sees:
AAA=aaa echo $AAA
It puts AAA=aaa in the enviroment of the echo process if creates (or
simulates with a builtin). *But* it is bash which expands the $AAA, and as
far as bash is concerned, AAA=previous value or not set at all.
Max.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/