[Nottingham] sed question

Michael perl at tecspy.com
Sat Sep 24 19:12:25 BST 2005


David Aldred wrote:
> Probably a very basic one!

You hit reply to a thread mail - quite a few people have been guilty of 
this recently! Please, everybody, start a new thread for a new thread!

> How do I use sed to make changes to a file, with the changes being written 
> back to the file?   

Use Perl! e.g.: -

     perl -pie "s/this/that/;" *.whatever.txt

...or awk -- they both have this feature whereas sed, "stream editor", 
edits streams

Regards,
Michael Erskine



More information about the Nottingham mailing list