Re: Beware of bash 3.1

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

 



On 4/28/06, Callum Lerwick <seg@xxxxxxxxxx> wrote:
> Okay, I originally posted about this a few months ago:
>
> http://www.redhat.com/archives/rhl-devel-list/2006-January/msg00491.html
>
> A seemingly harmless corner case. Here's another one:
>
> <BobJensen> one of my guys ran a java install script as sudo and fubar'd
> the box
> <BobJensen> he was following these instructions
> http://fedorasolved.org/browser-solutions/java-i386/
>
> Step 9, which looks like this:
>
> cat <<EOF > /etc/profile.d/java.sh
> export JAVA_HOME=/opt/jre1.5.0_06
> export PATH=$JAVA_HOME/bin:$PATH
> EOF
>
> Results in this:
>
> # cat /etc/profile.d/java.sh
> export JAVA_HOME=/opt/jre1.5.0_06
> export PATH=/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
>
> Which is wrong. The fix is of course:
>
> # cat <<EOF > ~/java.sh
> > export JAVA_HOME=/opt/jre1.5.0_06
> > export PATH=\$JAVA_HOME/bin:\$PATH
> > EOF
>
> # cat ~/java.sh
> export JAVA_HOME=/opt/jre1.5.0_06
> export PATH=$JAVA_HOME/bin:$PATH
>
> So... bash 3.1 has definitely changed the way variable expansion is
> done, namely it expands things it didn't used to expand. Bug or feature?
> Either way, beware.
>

In my bash addled brain.. I would say it is a bug. Expanding out data
that is being done in an EOF does not look in any way sh/ksh/etc
compliant.. and just prone to breaking too many things.




--
Stephen J Smoogen.
CSIRT/Linux System Administrator

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux