Is there a program like grep that not only tells me the line but the character position of a match?

I was hoping the byte-offset would give me what I wanted. In the following example, I would have expected an output of 4 (or 3):

echo "foobar" | grep -b b
0:foobar

Is there a way to make grep report the offset as 4? Is there some other program?

This is under Mac OS X, RHL9, FC1, FC3, Knoppix 3.8+

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software.  Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent


_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to