replaceInAll script working on cli but not as an .bashrc function

70 views Asked by At

This .bashrc function is working on the command line, its a nice bash one line'er.

but moving it into the bash profile and it stops working ?

replaceInAll (){ find . -name "$1" -print | xargs sed -i 's/$2/$3/g' }

what am i not getting wright with this ?

1

There are 1 answers

0
dmc On BEST ANSWER

This works

replaceInAll (){ find . -name "$1" -print | xargs sed -i s/"$2"/"$3"/g }