Hi All,
I need to write a script to find all ".sh" files in /home file system and if any string find ".sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this.
while read filename
do
sed -i 's/vijay@/vijay.bhaskar@/g' $filename
done < ~/mylist
If you hit permission errors then you need to rethink what you are doing because you may have selected system files you should not have changed earlier.
You can run the file loop statement over and over until you are error free. Why? Because will not change anything in files it already fixed.
Check back here if you need help.
Edit:
Rudi beat me to an answer. I still think a little caution is good idea as well.