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

Re: replace string



On 25Oct2008 13:13, Yong Huang <yong321 yahoo com> wrote:
| > From: "Mad Unix" <madunix gmail com>
| > find /dir -name "*.html" -exec sed i 's/"old"/"new"/g' {} \;
| 
| Even if you get your sed command right, that won't do in-place
| replacement, because if you use sed, the result has to be saved to a
| different file and you mv that file to overwrite your original file.

He is trying to use GNU sed's -i option, which does the same kind of thing as
Perl's -i (in place edit) option, with the same often-undesirable hard link
breakage.
-- 
Cameron Simpson <cs zip com au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Microsoft is not the ANSWER.
  Microsoft is the QUESTION,
    and the ANSWER is NO!       - Roland Giersig aut alcatel at



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