[SLUG] grep sed

john at johnallsopp.co.uk john at johnallsopp.co.uk
Mon Feb 27 16:17:53 GMT 2006


> john at johnallsopp.co.uk wrote:
>> grep -l "+44 123 4567" *.php | xargs sed 's/+44 123 4567/+44 765
>> 4321/g' | tee out.txt
>
> "man sed" says:
>
>       -i[SUFFIX], --in-place[=SUFFIX]
>
>              edit files in place (makes backup if extension supplied)
>
> Does that help?

Oh FFS. Now look. I looked through 2 LPIC books, Linux quick fix, and
Linux in a Nutshell before asking, and didn't find that.

I didn't do man sed because I thought LiaN was basically the MAN pages
printed out.

I was determined not to get caught by a RTFM situation, which is why I
really, really did.

But I didn't, did I.

Anyway, as it turns out, there aren't that many instances so I've made
the changes now, manually.

-i looks like it might have worked, <teeth option="gritted">cheers
Steve</teeth>.

J




More information about the Scarborough mailing list