Beware of bash 3.1

Stephen John Smoogen smooge at gmail.com
Sun Apr 30 01:00:23 UTC 2006


On 4/29/06, Matthias Saou
<thias at spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net>
wrote:
> Stephen John Smoogen wrote :
>
> > On 4/28/06, Stephen John Smoogen <smooge at gmail.com> wrote:
> >
> > > > cat <<EOF > /etc/profile.d/java.sh
> > > > export JAVA_HOME=/opt/jre1.5.0_06
> > > > export PATH=$JAVA_HOME/bin:$PATH
> > > > EOF
> > > >

>
> Yeah, isn't the proper fix to simply single quote 'EOF'? Like this :
>
> cat << 'EOF' > /etc/profile.d/java.sh
> export JAVA_HOME=/opt/jre1.5.0_06
> export PATH=$JAVA_HOME/bin:$PATH
> EOF
>
> This should keep the $VARIABLES from being expanded in the resulting file.
>

Yes I think it is. I prefer to stay away from EOF data's because of
forgetting one thing or another can cause weird thing to happen. I
think I have used it more in Perl (and maybe Awk) than I have in
Bash/Ksh

--
Stephen J Smoogen.
CSIRT/Linux System Administrator




More information about the fedora-devel-list mailing list