Q. I want to write a 2 line program that lets me substitute "the" with "zee" and "The" with "Zee".
Here is what I'm doing:
I'm writing a sed program for example, program.sed
. Inside it, I'm writing
s/the/zee/ \\
The/Zee/g
Then I'm running program.sed
like this
sed -f program.sed otherfilename
ERROR:
Unfortunately, error occurs, saying command garbled: s/the/zee/g
NOTE: If I do change text c\\
in sed
with any other commands etc. it works fine, but the problem is with substitution like for example in the above question.
EDIT:
The down solution worked for me the first one before Or, but not the second one. Maybe because the gator version is pretty old. "Oracle Corporation SunOS 5.10 Generic Patch January 2005". sed
version is very old also "23 July 1998". Just wanted others know.
sed (GNU sed) 4.2.2
and it worked finec\\
, but your example code only contains\\
. Which is correct, and what do you think that should do?s/the/zee/g
does not appear in input)sed --version
if it is available (or perhaps available inman sed