3 ms·
It's not clear to me what point you're trying to make, but the second one gives an error: "-e expression #1, char 2: unknown command: `''", because it's getting
by philh 16y ago
It's not clear to me what point you're trying to make, but the second one gives an error: "-e expression #1, char 2: unknown command: `''", because it's getting a single argument containing a quote.
Removing the quotes gives "-e expression #1, char 10: unknown option to `s'", because "s/a/b/g -f" is not a valid sed command.
And to illustrate my point about env, sed for me is in /bin. But "#!/usr/bin/env sed -f" doesn't work, because it looks for a program named "sed -f".
- JoachimSchipper 16y agoI was agreeing with you, and providing a simple testcase to show that you were, indeed, right (because I agreed that the behaviour is somewhat surprising). Sorry if that wasn't clear.