I have long produced extraordinarily productive and useful one liners using
the old "find -blah -blah | xargs grep blah sort of pipeline.... (Say "info
finding files" if you don't know this trick.)
Now I have a new weapon in my arsenal!
The limitation of grep is that it only finds lines matching, searching
across multiple lines and searches involving nested regions are just not
doable with grep....
But sgrep can
eg.
All {..} blocks not referring to fred
sgrep '("{".."}" not containing "fred")' filename.c
All C style comments with my name.
sgrep '("/*".."*/") containing "Carter"' *.c
sgrep is available from Ubuntu synaptic or from...
http://www.cs.helsinki.fi/u/jjaakkol/sgrep.html
--
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : [email protected]
New Zealand
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================
_______________________________________________
Linux-users mailing list
[email protected]
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users