% cat temp $$$ hello1 $$ hello2 hello3 ## hello4 hello5 $$$ % cat temp | grep \"$$$\" Illegal variable name. % cat temp | grep \"\\$\\$\\$\" Variable name
$ grep '\$\$\$' temp $$$ hello1 hello5 $$$
There's a superflous 'cat' in your command.