I want to echo
/printf
a dollar sign into a file - but echo $ > myfile
or such does not work (not surprising).
I tried escaping it like echo \$ > myfile
but it is also not working.
What is the correct way to perform it?
I'm working with TCSH on SunOs.
You can use printf and single quotes to avoid variable expansion:
From this link, you can use the \x24 method, where 24 is the hex for the dollar sign. Just that this structure doesn't work 100% with string using the double quote, so you probably want to use a single quote. So this statement
will create somefile with the content