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

Re: Beware of bash 3.1



On 4/29/06, Matthias Saou
<thias 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 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


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