I currently have a shell script (findreplace.ksh) that finds a word and replaces it with another word for all files in the specified directory
#findreplace.ksh :
perl -e "s/${1}/${2}/g;" -pi $(find ${3}/ksh -type f)
Hence I would run the script as :
findreplace dummy nodummy temp
This would replace all occurances of dummy to nodummy in the temp/ksh folder.
Now how do I do the following :
If my arguments ${1} and ${2} have spaces in them, what option can I give to make it work ?
For example, I need to replace the word <I am a Dummy> with <Not anymore a dummy" in the same fashion ?
Also, I am interested in knowing if there are any other options to doing a find and replace(besides the perl command)
Thanks