vi change.sh
#!/bin/bash
orig=$1
temp=$1.tmp
findstring=$2
changestring=$3
exp_findstring=${findstring//./\\.}
exp_findstring=${exp_findstring//\//\\/}
exp_changestring=${changestring//./\\.}
exp_changestring=${exp_changestring//\//\\/}
cp $orig $temp && \
sed -e "s/$exp_findstring/$exp_changestring/g" $temp > $orig && \
rm $temp
exit 0
댓글 없음:
댓글 쓰기