I want to write a sed script where the echoing is off, like
#!/bin/sed -n -f
s/x/u/g
but that gives my an
Invalid option -- ' '
error.
How can I do this?
I want to write a sed script where the echoing is off, like
#!/bin/sed -n -f
s/x/u/g
but that gives my an
Invalid option -- ' '
error.
How can I do this?
It's because you tried to pass more than one argument in the shebang. Compare:
In this particular case you can compact -n -f to -nf. In general this is not always possible. Here the script will be:
#!/bin/sed -nf
s/x/u/g
Note: It seems to me the script in its current form will print nothing because of -n. I assume you're going to expand it.