replace string

Cameron Simpson cs at zip.com.au
Sun Oct 26 00:33:30 UTC 2008


On 25Oct2008 13:13, Yong Huang <yong321 at yahoo.com> wrote:
| > From: "Mad Unix" <madunix at 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 at 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 at aut.alcatel.at




More information about the redhat-list mailing list