Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Originating-IP: [195.224.233.3] From: "John Vincent" To: emcb_exposure AT hotmail DOT com, hzhr AT 21cn DOT com Cc: cygwin AT cygwin DOT com Subject: Re: About ENV? Date: Fri, 18 Oct 2002 10:11:08 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 18 Oct 2002 10:11:08.0803 (UTC) FILETIME=[AD7F4D30:01C2768E] Hi, Not quite right there ... You can preceed a command with an assignment, and the assigned variable is then put into the environment of the command that is run. Thus the command "echo" is run with an environment variable AAAA with the value aaaa. However, this does not change the AAAA shell variable (which is currently empty) so the echo prints a blank (it's empty argument) and ignores the AAAA in it's environment. This syntax is useful for setting environment variables for one command invocation only. They are not saved. I hope this fully explains what is going on. /John Vincent. >From: "Elfyn McBratney" >To: "Huang." >CC: >Subject: Re: About ENV? >Date: Fri, 18 Oct 2002 10:03:05 +0100 > >Its just bash topology... If your setting a variable and calling a command >after it, or doing anything on one line with another expression after it >you >need to end the expression before starting another one, which is done with >the semi-colon ';'. > >On the first one: > >$ AAAA=aaa echo $AAAA > >AAAA now looks like "aaa echo " unless AAAA already exists, and if so would >contain the variable contents after the "echo " bit... > >Elfyn >----- Original Message ----- >From: Huang. >To: >Sent: Friday, October 18, 2002 7:31 AM >Subject: About ENV? > > > > Why env in cygwin work like these: > > > > $ AAAA=aaa echo $AAAA > > > > > > $ AAAA=aaa; echo $AAAA > > aaa > > > > $ echo $AAAA > > aaa > > > > > > Maybe it not correct? > > > > Thanks. > > > > > > > > > > > > > > -- > > 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/ > > > >-- >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/ _________________________________________________________________ Unlimited Internet access for only $21.95/month.  Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- 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/