[YLUG] How do to substition in a file with sed or similar
Ewan Mac Mahon
ewan at macmahon.me.uk
Fri Oct 27 12:22:06 BST 2006
On Fri, Oct 27, 2006 at 11:47:56AM +0100, Robert Hulme wrote:
> Hi list,
>
> I know I can:
> sed s/foo/bar/ myfile
>
> which dumps to stdout
>
> How I do the substition on the file 'in place'?
>
With the sed 'in place' switch, this, from the man page:
-i[suffix], --in-place[=suffix]
edit files in place (makes backup if extension supplied)
Also - Perl!? I know there's more than one way to do it, but this one
doesn't involve loading a great big interpreter.
Ewan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/york/attachments/20061027/6eec0c3e/attachment.bin
More information about the York
mailing list