delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/10/18/06:11:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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" <jpv50 AT hotmail DOT com>
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
Message-ID: <F864nbV6lznZC3c1QRo00001fe2@hotmail.com>
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" <emcb_exposure AT hotmail DOT com>
>To: "Huang." <hzhr AT 21cn DOT com>
>CC: <cygwin AT cygwin DOT com>
>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. <hzhr AT 21cn DOT com>
>To: <cygwin AT cygwin DOT com>
>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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019