If you're using bash, I've always found the
Advanced Bash-Scripting Guide.
Basically, to write out a file, you need to "echo" out values. That is,
Code:
echo ${FOO} >> ${FILE}
In case you don't know, '>>' appends the output to the specified file, whereas '>' over-writes what's currently there.