Hi,
Here is use perl.
---
#!/bin/sh
for Files in `find /data -type f`
do
perl -i -pe 's/basher one/smasher two/g' $Files
done
----
Wesly
Main Topics
Browse All TopicsHello. Using bash, I would like to check all the files in /data directory for the words: basher one
and replace them with the words: smasher two
Any ideas?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks for the comments. I have to use bash. Tintin, I get an error with the bash script. It reads,
sed: can't read /samba/ISO/search_test.txt
sed: can't read string: No such file or directory
The file, search_test.txt, that it is referring to has the search string in it, so its getting that far. I put the search string (which is actually search string) in search_test.txt, under the directory /samba/ISO
My script is as follows:
for file in $(grep "search string" /samba/ISO/*)
do
sed 's/search string/replace string/g' $file >/tmp/$$ && mv /tmp/$$ $file
done
I have made a new question for this case.
Please check http://www.experts-exchang
Cheers,
Hossam
Business Accounts
Answer for Membership
by: TintinPosted on 2005-01-31 at 15:38:18ID: 13188220
for file in $(grep "basher one" /data/*)
do
sed 's/basher one/smasher two/g' $file >/tmp/$$ && mv /tmp/$$ $file
done