[Toybox] [toybox] fold implementation

Rob Landley rob at landley.net
Thu Apr 3 15:56:44 PDT 2014


On 04/02/14 20:25, Samuel Holland wrote:
> Hello, everyone.
> 
> Here is a basic implementation of fold[0]. It does not support multibyte characters, though that would probably just require more switch cases. This is my first contribution, so please comment your thoughts/what I can improve.

Seems pretty decent. Applied to pending.

> I was planning to write an "unfold" utility that basically did the opposite. Although I don't think it's in any standard, would it still be of any interest?
> 
> [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fold.html

The -u option to fold isn't currently being used...

Could you describe a little more how unfold would work?

Rob

 1396565804.0


More information about the Toybox mailing list