I have a file such as this, which I am wanting to manipulate with sed
.
// file.js
return foo.quux();
Running the following:
$ sed -i "s/foo\.(?!bar|baz)/qux\./g" file.js
Expected the file to be replaced such as:
// file.js
return qux.quux();
But bash
keeps telling me:
bash: !bar: event not found
Rewrote as:
$ sed -i "s/foo\.(?'!'bar|baz)/qux\./g" file.js
But bash
still wants to use the exclamation point for it's own purposes:
bash: !: event not found
Anyone have any tips on how to craft the exclusion for sed
without bash
trying to get involved?