sed - changing occurence (csh)

April 8, 2009 at 00:37:13
Specs: Windows XP
Hi, im trying to figure out, how to combine different sed commands in a single script. This script should replace the given characters (the -> le, The -> Le) but leave words "other" and "there" as they are. So far I have four commands that do the same thing but each next one just starts working with a fresh file instead of just modifying what was already modified. I am not sure how to combine them all in one. Any idea? Thanks !!

This is what I have so far:

# write a program to change certain occurences
sed 's/the/le/g' $1
sed 's/The/Le/g' $1
sed 's/oler/other/g' $1
sed 's/lere/there/g' $1

See More: sed - changing occurence (csh)

Report •

April 8, 2009 at 08:45:57
The sed -e switch is used to perform multiple edits on the same file. Check out this link:

Report •
Related Solutions

Ask Question