Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- change() {
- from=${1}
- shift
- while [ $# -gt 0 ]; do
- case ${1} in
- "to")
- shift
- to=${1} ;;
- "in")
- shift
- file=${1} ;;
- esac
- shift
- done
- if [ -n $from -a -n $file ]; then
- eval "sed -i 's%${from}%${to}%g' $file"
- else
- stop "poorly formed change statement"
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment