🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #364

"export foo=bar" bug

#364
From: James J Dempsey
Date: Thu, 20 Jul 1989 15:03
34 lines
1041 bytes
I always thought that the csh syntax of setting environment variables:

setenv foo bar

was a lot cleaner than sh syntax:

foo=bar
export foo

so I was overjoyed when someone on this list pointed out that in bash
you could say:

export foo=bar

which is just as clean as the csh syntax.  However, I seem to have
found a bug:

$ xxx='foo\bar'
$ echo $xxx
foo\bar
$
$ yyy=$xxx
$ echo $yyy
foo\bar
$ export zzz=$xxx
$ echo $zzz
foobar
$

The above script shows that if you use the "export foo=bar" notation
that backslashes in the right side are deleted.  This doesn't happen
if you use "foo=bar;export foo" notation.

		--Jim--
Technical Details
Message-ID: <8907201503.AA17393@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!BBN.COM!jjd

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!BBN.COM!jjd
From: jjd@BBN.COM (James J Dempsey)
Newsgroups: gnu.bash.bug
Subject: "export foo=bar" bug
Message-ID: <8907201503.AA17393@life.ai.mit.edu>
Date: 20 Jul 89 15:03:03 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 34