I have a many folders in a directory under which there are many subdirectories containing text files containing the word "shyam" in them.I want all the files in all the directories containing "shyam to "ram" ??
sed "s/shyam/ram/g" does it ??But anyone can help me with the script ??
find <top-level-directory> -type f | while read INFILE
do
if grep -q shyam ${INFILE}
then
sed -e "s/shyam/ram/g" ${INFILE} > tmpfile
mv tmpfile ${INFILE}
fi
done