[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] Re: new version hook script examples
From: |
Miles Bader |
Subject: |
[Gnu-arch-users] Re: new version hook script examples |
Date: |
Wed, 10 Nov 2004 17:46:18 +0900 |
Mikhael Goikhman <address@hidden> writes:
>> perl -e "..." -e "..."
>
> I would not suggest this for newbies, this joins the "..." strings using
> a newline, so one should still end the statements with a semicolon.
> Just use a single -s and any whitespace (including newlines) you like:
>
> perl -pi -e 's/old1/new1/g; s/old2/new2/gi;' file1 file2
That works in GNU sed too, and then you don't need the "-e", e.g.:
sed -i 's/old1/new1/g; s/old2/new2/g' file1 file2
Very convenient.
[Old seds (like sunos or whatever) can't handle this type of thing though.]
-Miles
--
If you can't beat them, arrange to have them beaten. [George Carlin]