I want to put a string (comprising of specially ! sign) in a variable, say,
var="!f then"
Then I want to display the string or use it elsewhere:
echo $var
But when I enter with var="!f then" it gives the following:
var="for f in Tor*; do mv "$f" "$f-Win"; done then"
If I use escape like var="\!f then", then the escape character also comes in the string.
$ echo $var
\\!f then
How can I use ! as an element in a string?