The -e
option of sed
is to input a valid sed
expression, not a file name containing sed
commands, the -f
option is for filename containing valid sed
expressions.
In your case:
sed -e sedscript.sh
is being treaded as a substitution (s
) operation of sed
as the expression starts with s
, with e
as the delimiter for s
(substitution), and sed
is rightly complaining about the unterminated s
(substitution) command.
Have fun:
% sed -e sedscript.sheFOOe <<<'dscript.shBAR'
FOOBAR
What you can do:
Your file is necessarily a shell script, you can simple execute that as so
Use -e
to put the expession on the command line directly, -e
is not strictly needed though:
sed 's/^ *[0-9]\+.//g' tictactoeold.py >tictactoenew.py
sed -e 's/^ *[0-9]\+.//g' tictactoeold.py >tictactoenew.py
Use the -f
option, and just keep the sed
expressions in the file only i.e. make the file sedscript
as:
s/^ *[0-9]\+.//g
and then use the sed
command as:
sed -f sedscript tictactoeold.py >tictactoenew.py
-e
option is to add ased
script, not a shell script. – Byte Commander Sep 27 '16 at 11:40