[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: replace string



On 24Oct2008 23:26, Mad Unix <madunix 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 zip com au> DoD#743
http://www.cskk.ezoshosting.com/cs/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]