reinplace - how to remove a new line char

Rainer Müller raimue at macports.org
Sat May 30 06:32:01 PDT 2009


On 2009-05-30 00:11, Darren Weber wrote:
> An example of how to remove a line with some search text in it.  Assume
> tmp.txt contains:
> 
> # BEGIN (not in file)
> abc
> def
> # END (not in file)
> 
> reinplace {$!N;s|^.*abc.*\\n||g} tmp.txt

Easier sed syntax to remove a line would be:

reinplace {/^.*abc.*/d} tmp.txt

Rainer


More information about the macports-dev mailing list