% cat temp $$$ hello1 $$ hello2 hello3 ## hello4 hello5 $$$ % cat temp | grep \"$$$\" Illegal variable name. % cat temp | grep \"\\$\\$\\$\" Variable name
How about ^.*[$]{3}.*$
^.*[$]{3}.*$