i***f 发帖数: 10 | 1 Hi,
Today when I try to replace a string in many files, first
I tried to use "sed -e s/STRING1/STRING2/g *" and only found
out the replaced pattern was output to STDOUT. At last I have
to write a script like this:
#/bin/sh
for fn in *
do {
sed -e s/STRING1/STRING2/g $fn > out.tmp
cp -f out.tmp $fn
}
done
rm -f out.tmp
Anyone can suggest to do the same function by using only one
line? |
|