I need to write multiple sed script files. I can’t seem to find a way to enable extended regex from within the script. Is this possible? It isn’t possible for me to use option flags because the scripts need to run on an external environment which isn’t under my control.
I need to write multiple sed script files. I can’t seem to find a
Share
You can try specifying the flag in the script shebang, say:
And then tell the admin to run the script as is (
chmod a+xit first, then./script.sed) so the shebang line is used for finding the right interpreter.You may need to substitute
/bin/sedwith the right path for your environment. Unfortunately you probably won’t be able to use/usr/bin/env sed -rfor this (the extra-ris a problem).