Reputation: 303
I need to create a bash file to rename files,where I need to have filename with $ symbol.
Eg:- Na$me
how can I escape this $ symbol, / is not working to escape $ symbol
Upvotes: 2
Views: 79
Reputation: 113844
There are two ways to deactivate $
in shell:
You can use single-quotes:
$ var='Na$me'; echo "$var"
Na$me
You can use a backslash:
$ var=Na\$me; echo "$var"
Na$me
Upvotes: 6