Results 1 to 2 of 2
I'm running sed in WinXP on a text file using a script file. Every time I run it I get an unknown option to 's' error:
C:\Program Files\GnuWin32\bin>sed -f jagerize.sh ...
- 02-21-2011 #1Just Joined!
- Join Date
- Feb 2011
- Posts
- 2
Sed.exe Unknown Option to 's'
I'm running sed in WinXP on a text file using a script file. Every time I run it I get an unknown option to 's' error:
I've tried two different implementations of sed, with the same result. Deleting the offending line in the script file still produces the same result (as the next line has the same syntax). I'm guessing the problem has something to do with WindowsXP, but I'm a complete newbie with sed and Linux.C:\Program Files\GnuWin32\bin>sed -f jagerize.sh input.txt>output.txt
sed: file jagerize.sh line 22: unknown option to 's'
Help?
Thanks,
-Phil
Here is the script file I am using:
#!/bin/sh
#
# Jagerizer 1.2
#
# Copyright 2002
# Andres Santiago Perez-Bergquist
# REDACTED (I can't post URLs yet)
#
# Permission is granted to copy and distribute this file for personal use.
# Jagermonsters are Copyright Phil & Kaja Foglio
#
# To use, make sure the executable bit is set and run from the command line.
# By default, it reads from stdin and writes to stdout, but redirecting is
# advisable, to keep the input and output from getting mixed together.
sed -e "s/this/dis/g" \
"s/This/Dis/g" \
"s/THIS/DIS/g" \
"s/that/dat/g" \
"s/That/Dat/g" \
"s/THAT/DAT/g" \
"s/they/day/g" \ <----- this is line 22, where the error pops up.
"s/They/Dey/g" \
. . .
"s/Okay/Hokay/g" \
"s/OKAY/HOKAY/g" \
"s/just/chust/g" \
"s/Just/Chust/g" \
"s/JUST/CHUST/g"
- 02-22-2011 #2Just Joined!
- Join Date
- Feb 2011
- Posts
- 2
Solved It
The problem was my complete lack of experience with sed.
When I edited the file to this:
s/this/dis/g
s/This/Dis/g
s/THIS/DIS/g
s/that/dat/g
s/That/Dat/g
s/THAT/DAT/g
s/they/day/g
s/They/Dey/g
. . .
s/Okay/Hokay/g
s/OKAY/HOKAY/g
s/just/chust/g
s/Just/Chust/g
s/JUST/CHUST/g
It worked just fine.
So, "We thought you were having fun." becomes, "Ve tought hyu vere hevink fun."
Sorry to have bothered you.
-Phil


Reply With Quote