[TriLUG] solved: HERE document question

Kevin Hunter hunteke at earlham.edu
Tue Jul 27 19:17:04 EDT 2010


At 12:19pm -0600 Tue, 27 Jul 2010, Joseph Mack NA3T wrote:
> cat $filename> <<\EOF
> if [ "$count" = "0" ]
> EOF

It's been awhile since I've used Bash 2.05b (with Valhalla, I think), 
but now you can get finer control with the backslash character:

cat > $filename <<EOF
   if [ "\$count" = "0" ] ...
EOF

will do the trick.  Also of note is that it's generally cleaner to quote 
filenames (would you /ever/ put a space in there?):

cat > "$filename" <<EOF ...

And, as Shane said, I'm still not clear on exactly what you wanted, but 
glad you got it fixed.

Cheers,

Kevin



More information about the TriLUG mailing list