If you are doing a lot of lines all at once... it is best to do the following
Code:
MYVAR=123
# use > to write over the whole file
# use >> if you want to append to the end
cat > file_name << EOF_ANYTHING_GOES_HERE
this is all text treated
as if it was quoted with ""
you can use variables such as \$MYVAR=$MYVAR
and you can use commands like: `date`
To end the file, place a matching phrase from after the << right up against the
left side. DO NOT INDENT! that requires <<-SOMETHING_ELSE
EOF_ANYTHING_GOES_HERE
I don't have a linux box with me at work... BUT that will get you headed in the right direction.
the ` mark on `date` is the mark from the tilde~ key
I use this method when i need to build a dynamic menu for blackbox/openbox