I am trying to run a grep regular expression on a file, where I have to exclude lines where "00" and "0" appear. I came up with this expression:
grep -a -E \"stored\"\:\ \"\*123\*(?!00)[0-9]{2,5}\#\" $filename
But when I try to run it in bash, I either get
-bash !00: event not found
, or (once I have typed set +H
),
-bash: syntax error near unexpected token
('`
Please what do I need to do to properly escape this regular expression in bash?