X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Date: Thu, 14 Feb 2002 17:29:05 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Tim Van Holder cc: djgpp-workers AT delorie DOT com Subject: Re: Some small bash issues In-Reply-To: <1013690570.30677.90.camel@bender.falconsoft.be> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 14 Feb 2002, Tim Van Holder wrote: > [tim AT bender] /home/tim>cat >fooscript <<\EOF > More>#! /bin/sh > More>echo $foo > More>EOF > [tim AT bender] /home/tim>foo=bar ./fooscript > bar > [tim AT bender] /home/tim>echo $foo > > [tim AT bender] /home/tim>cat >fooscript <<\EOF > More>#! /usr/bin/perl5 > More>print $ENV{"foo"} . "\n"; > More>EOF > [tim AT bender] /home/tim>foo=bar ./fooscript > bar > [tim AT bender] /home/tim>foo=bar perl -e 'print $ENV{"foo"} . "\n";' > bar > [tim AT bender] /home/tim>echo $foo > > [tim AT bender] /home/tim>foo=bar perl -e 'print $ENV{"foo"} . "\n";' > bar > > So running perl DOES set foo; running echo doesn't. Yes, but that's a different issue, I think: what I was talking about is whether foo=bar is in effect for the duration of the single command after "foo=bar". You are talking, so it seems, about whether foo=bar stays in effect _after_ that command exits. I don't expect the latter to happen in a shell, but as for Perl, I don't know enough about its semantics to judge.