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 Message-ID: <029f01c276da$fd3ee1e0$e9fb80d9@exostation> From: "Francois de Campagnolle" To: Subject: Fw: About ENV? Date: Fri, 18 Oct 2002 21:17:22 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 A more practical example (if you are in GMT-2 e.g France): TZ=GMT+22 eval lastlogfile=log_'$(date +%Y%m%d)'.log FRC ----- Original Message ----- From: "James Hu" To: Sent: Friday, October 18, 2002 5:56 PM Subject: Re: About ENV? > In article <3DAFAAB7 DOT 6070502 AT 21cn DOT com>, Huang. wrote: > > Why env in cygwin work like these: > > I am sure this is off topic, since all UNIX shells based on Bourne > shell will behave this way. This is not specific to Cygwin. > > > $ AAAA=aaa echo $AAAA > > This syntax says: Set variable AAA to aaa in the environment of the > command "echo $AAA". However, the command "echo $AAA" will echo the > value of variable AAA in the current environment, since the expansion > of variables occurs before the command is executed. > > > $ AAAA=aaa; echo $AAAA > > aaa > > According to the explanation above, this is expected behavior. > > > $ echo $AAAA > > aaa > > According to the explanation above, this is expected behavior. > > To do what I think you want to test try the following: > > AAA=bbb eval 'echo $AAA in' ; echo $AAA out > or AAA=bbb sh -c 'echo $AAA in' ; echo $AAA out > or (AAA=bbb; echo $AAA in) ; echo $AAA out > > All of these commands involve echoing the value of AAA in an environment > that is in the inner scope of the environment of the command line. > > -- James > > > > -- > 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/