What I would like to do is something like the following:
#!/bin/sh
EMAIL="-e 's/SOMETHING//g'"
somecommand | sed "$EMAIL"
But I get the following:
sed: -e expression #1, char 2: unknown command: `''
I've tried many variations. I know it just a matter of getting the string quoting right. The reason I'd like to do this is to break a long sed command up for readability. Should I just use a sed script-file (with the -f option) instead?
UPDATE:
My actual script is a little more complex:
#!/bin/sh
EMAIL="-e s/SOME THING//g -e s/SOME THING ELSE//g ..."
somecommand | sed "$EMAIL"
After removing the single quotes I get:
sed: -e expression #1, char 18: unknown option to `s'