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

If you need to include variables -- escape, escape, escape!

set abcVar abc
reinplace "\$!N;s|^.*${abcVar}.*\\n||g"

The result should be:

# BEGIN (not in file)
def
# END (not in file)


Regards,
Darren

PS, Thanks to google refs for some relevant sed tips, e.g.:
http://www.computing.net/answers/unix/remove-all-n-in-sed/7399.html
_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to