[Toybox] new toy: rev
Elie De Brauwer
eliedebrauwer at gmail.com
Sun Dec 16 03:38:10 PST 2012
Hi Rob, hello world,
In attachment you can find an implementation of 'rev' including tests.
As far as I know it's included in posix, nor lsb but it lives in
util-linux and busybox also has it.
edb at lapedb:~/edb-stuff/toybox/toybox$ echo "abc" | rev
cba
edb at lapedb:~/edb-stuff/toybox/toybox$ echo -en "abc\ndef" | rev
cba
fed
edb at lapedb:~/edb-stuff/toybox/toybox$ echo "abc" | ./toybox rev
cba
edb at lapedb:~/edb-stuff/toybox/toybox$ echo -en "abc\ndef" | ./toybox rev
cba
fed
I just wrote it because it was rather easy and I bumped into it while
looking at tac yesterday, btw it also suffers from the /dev/full bug
since it also uses xputs.
gr
E.
--
Elie De Brauwer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rev.patch
Type: text/x-patch
Size: 2308 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20121216/35b46821/attachment-0006.bin>
More information about the Toybox
mailing list