From: David Kastrup Date: Wed, 28 Nov 2007 23:10:34 GMT Subject: Re: [PATCH v2] Replace instances of export VAR=VAL with VAR=VAL; export VAR Message-ID: <85mysy6k5x.fsf@lola.goethe.zz> In-Reply-To: <20071128230203.GA13964@coredump.intra.peff.net> Jeff King writes: > On Wed, Nov 28, 2007 at 11:53:13PM +0100, David Kastrup wrote: > >> dak@lola:~$ ash >> $ export JUNK=woozle >> $ sh -c 'echo $JUNK' >> woozle >> $ exit >> dak@lola:~$ dash >> $ export JUNK=woozle >> $ sh -c 'echo $JUNK' >> woozle >> $ exit >> >> What problem are we talking about exactly, and with what shell? > > $ uname -sr > FreeBSD 6.1-RELEASE-p17-jc1 > $ /bin/sh > $ FOO='with spaces' > $ echo $FOO > with spaces > $ OK=$FOO; export OK > $ sh -c 'echo $OK' > with spaces > $ export BAD=$FOO > $ sh -c 'echo $BAD' > with > $ echo $BAD > with I'd write export BAD="$FOO" anyhow. And also OK="$FOO" by the way. The alternatives scare me. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum