replace string

Cameron Simpson cs at zip.com.au
Fri Oct 24 22:31:28 UTC 2008


On 24Oct2008 23:26, Mad Unix <madunix at gmail.com> wrote:
| i need your feedback about this command, it should find a string in
| multiple html files in a directory and replace it with a different
| string...
| 
| find /dir -name "*.html" -exec sed i 's/"old"/"new"/g' {} \;

Well, yeah, if you had spelt the "-i" option correctly.
But if you have hard links in there (unlikely, but some people do)
it will break them if it modifies the file.

I have no idea what kind of "feedback" you were after...
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/




More information about the redhat-list mailing list