[Toybox] New toy: tail

Tim Elliott tle at holymonkey.com
Thu Feb 23 12:26:26 PST 2012


Hi all,

Attached is an implementation of tail. It is disabled by default
because -f is not yet implemented.

This patch has a workaround for a limitation with toybox argument
parsing. The -c and -n parameters are numeric arguments that can be
prefixed with a + or - sign. If the sign is omitted, they default to
negative. I would be happy to add something to the argument parser to
handle this.

This patch implements its own llist_add() helper. I wanted to put
llist_add() in lib/llist.c, but I had difficulty getting the void
pointer dereferencing right. Perhaps I should try again?

In certain situations, tail should seek and read from the end of the
input. This current implementation always reads from the beginning.

Cheers,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tail.patch
Type: text/x-patch
Size: 5132 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120223/fb1524f8/attachment-0006.bin>


More information about the Toybox mailing list