On Mon, Jun 20, 2005 at 09:36:59AM +1000, David wrote: > I need to go through an entire directory replacing foo.bar with bar.foo > within each file and at the same time I also need to replace macintosh > line breaks with unix ones.
for file in $(ls /dir); do # String translation sed 's/foo\.bar/bar.foo/' $file | tr '\r' '\n' > $file.replaced mv $file.replaced $file done Test it in a sample directory first, I'm not 100% sure that tr will work as I expect... - Matt
signature.asc
Description: Digital signature
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html