Results 1 to 2 of 2
i am trying to write to a new file (filename) using cat and i require to use a $ as this is in the previously written script, but when i ...
- 07-05-2007 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 4
$ simple use of the dollar sign $
i am trying to write to a new file (filename) using cat and i require to use a $ as this is in the previously written script, but when i was testing to try and get a similar/simpler file to work...it doesn't
here's what i have
cat > filename << EOD
#
#
1 2 3
anything
$hello
#
#
EOD
and i get "hello: undefined variable"
but surely, it is just writing to text so it shouldn't matter about the $ ?
please help
- 07-05-2007 #2
$ sign is special character. prefix \ (backslash) to escape it.
Code:cat > filename << EOD # # 1 2 3 anything \$hello # # EOD
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First


Reply With Quote