| |
#!/bin/sh function usage { echo "usage: $0 org_txt new_txt file file..." } if [ $# -lt 3 ] then usage exit 1 fi org=$1 new=$2 shift shift for i in $* do printf "changing %-20s .... " $i if [ -f $i ] then sed "s/$org/$new/g" > temp 2>/dev/null < $i && mv temp $i && printf "done! " || printf "error " else printf "notfile " fi done
|
|