Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!nsc!voder!berlioz.nsc.com!nelson From: nelson@berlioz.nsc.com (Taed Nelson) Newsgroups: comp.unix.questions Subject: Word-oriented GREP Message-ID: <1991Apr15.014626.28903@berlioz.nsc.com> Date: 15 Apr 91 01:46:26 GMT Sender: news@berlioz.nsc.com Distribution: na Organization: PLD Software Group, National Semiconductor Co., Santa Clara, CA. Lines: 15 When I use the command "grep V\[0-9\]\[0-9\]\[0-9\] fred.c" it returns #define VERSION "V002" or somesuch. What I would really like is just the string of characters which matched: V002 I thought about it for a while, and I couldn't come up with anything; even AWK seems to offer no nice way of doing it, but this seems like something that is at least somewhat common... Does anyone have any suggestions, preferably limiting the solution to SH or CSH, and by not using uncommon tools such as PERL? Thanks a lot!