[plug] Here documents

David Buddrige buddrige at wasp.net.au
Fri Oct 3 12:01:03 WST 2003


Hi all, 

I want to use a 'here' document to append some text to the end of an 
existing text file.  I have been reading through 'A practical guide to 
Linux' - the section on shell programming but it does not seem to clearly 
explain how to specifically do this. 

My script goes like this: 

cat <<EOF
some text that
I want to add
to the end of my
file
EOF
>> somefile.txt

however this does not seem to work - the 'here' document text is simply 
output to standard-output. 

does anyone know how I would actually add the text in the here document to 
another file as above? 

thanks heaps 

David.
_______________________________________________
plug mailing list
plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug


More information about the plug mailing list