[Toybox] New toy: grep

Andre Renaud andre at bluewatersys.com
Sun Feb 26 20:01:33 PST 2012


Attached is a simplistic starter implementation of the grep command.
There are currently a few issues with it:
1. It doesn't intelligently cope with lines that fall over a 'toybuf'
read boundary. It should be stuffing the partial line back into toybuf &
appending the next read to the end.
2. It uses strcasestr for case-insensitive searches. This is a
non-standard GNU extension, which I presume we shouldn't be using
3. It doesn't handle the -E regular expression options. I see there is
some xregcomp options in the toybox lib - is this something that we'd
make conditional on a build option?

Regards,
Andre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grep.diff
Type: text/x-patch
Size: 3464 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120227/3c61a4dd/attachment-0006.bin>


More information about the Toybox mailing list