[Nottingham] sed question

David Aldred david at familyaldred.org.uk
Sat Sep 24 20:23:39 BST 2005


Probably a very basic one!

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

sed <expr> testfile just puts the results onto stdout; using '>testfile'at the 
end results in an empty file....

So far I've got to:

sed <expr> testfile > tempfile && mv -f tempfile testfile

which works, but seems a bit inelegant...

Is there a Better Way?

-- 
David Aldred



More information about the Nottingham mailing list