<div dir="ltr"><div><div>I personally would also find a pure simple single-purpose "unfold" useful.</div></div><div><br></div><div>If you feel like going just a touch beyond a simple "unfold", you might want to look at the fmt utility. I've seen several scripts in the wild that used fold and/or fmt. A couple of them used fold to do the folding and fmt (with really long maximum line specified) to unfold, which I thought was strange... after all, if you've got fmt, you can use it to do both "folding" and "unfolding", but whatever.</div>
<div><br></div><div><br></div><div>One thing to be aware of, it seems that there isn't a lot of consensus in terms of the fmt arguments. If there's a standard, it looks like it's mostly ignored.<br><div><br></div>
<div><a href="http://en.wikipedia.org/wiki/Fmt">http://en.wikipedia.org/wiki/Fmt</a></div></div><div><br></div><div><a href="http://www.freebsd.org/cgi/man.cgi?query=fmt&sektion=1&apropos=0&manpath=FreeBSD+6.2-RELEASE">http://www.freebsd.org/cgi/man.cgi?query=fmt&sektion=1&apropos=0&manpath=FreeBSD+6.2-RELEASE</a><br>
</div><div><br></div><div><a href="http://www.gnu.org/software/coreutils/manual/html_node/fmt-invocation.html">http://www.gnu.org/software/coreutils/manual/html_node/fmt-invocation.html</a><br></div><div><br></div><div><br>
</div><div>For what it's worth...</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 2, 2014 at 8:25 PM, Samuel Holland <span dir="ltr"><<a href="mailto:samuel@sholland.net" target="_blank">samuel@sholland.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, everyone.<br>
<br>
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.<br>

<br>
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?<br>
<br>
[0] <a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fold.html" target="_blank">http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fold.html</a><br>
<br>
<br><br>
<br>
<br>
Regards,<br>
Samuel Holland <<a href="mailto:samuel@sholland.net">samuel@sholland.net</a>><br>_______________________________________________<br>
Toybox mailing list<br>
<a href="mailto:Toybox@lists.landley.net">Toybox@lists.landley.net</a><br>
<a href="http://lists.landley.net/listinfo.cgi/toybox-landley.net" target="_blank">http://lists.landley.net/listinfo.cgi/toybox-landley.net</a><br>
<br></blockquote></div><br></div>