Ok, this is going to require some level of bash expertise, just to warn
everyone.  I have a script that writes data to a file.  One version of it
works, the other does not.  By "works," I mean that a symbolic substitution
is performed.  In detail, if I do this:
#!/bin/sh
VERSION=3.3
   cat > doinst.sh << EOF
( cd usr/bin ; ln -sf gcc-$VERSION gcc )
( cd usr/bin ; rm -rf s390-slackware-linux-gcc-$VERSION )
( cd usr/bin ; ln -sf gcc-$VERSION s390-slackware-linux-gcc-$VERSION )
EOF

When the output file, doinst.sh, is examined, the $VERSION variables have
been properly substituted with the value 3.3.  When I do this:
#!/bin/sh
VERSION=3.3
   cat > doinst1.sh << "EOF"
( cd usr/bin ; ln -sf gcc-$VERSION gcc )
( cd usr/bin ; rm -rf s390-slackware-linux-gcc-$VERSION )
( cd usr/bin ; ln -sf gcc-$VERSION s390-slackware-linux-gcc-$VERSION )
EOF

When the output file is examined, the $VERSION variables appear just like
that, as $VERSION, and not as 3.3.

So, can someone explain to me why this works the way it does?  Pointing to
the relevant passage(s) in the Bash man page should be sufficient.  If that
doesn't clear it up for me, I'll ask more questions later.

Thanks,

Mark Post

Reply via email to