bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enviroment variable lost value


From: Eric Blake
Subject: Re: enviroment variable lost value
Date: Wed, 10 Jun 2009 06:05:47 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Xiaoqiang Zheng on 6/10/2009 3:46 AM:
> # su - oracle<<EOF
>> LANG=C
>> i=bin
>> /$i/hostname
>> EOF

This is shell quoting bug on your part, unrelated to coreutils; you may
want to ask on a more appropriate forum.  You need to quote your here-doc
or provide escaping for the $ if you want the $ to be a literal part of
the script fed through su, rather than being interpreted by the shell
prior to the spawning of su.  In other words, one of these two approaches:

# su - oracle<<\EOF
LANG=C
i=bin
/$i/hostname
EOF

# su - oracle<<EOF
LANG=C
i=bin
/\$i/hostname
EOF

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkovoZsACgkQ84KuGfSFAYBe1wCgvbj8Y5nVozWhS5sO1Kbt434H
9s0An0nKSgjugjmDtES5xI0+k64IqSzk
=ygCE
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]