
To continue the trend set by James Clark... Here is my choice for useful command-line tool of the day. fold Fold is a simple little command line util that lets you fold lines of text at a particular width. Eg if you have some long lines of text, say out of some HTML or other document format that only maintains paragraph breaks, that you want to show on a console screen you can do this: fold -s -w 70 long-lines.txt |less This command will fold the text from long-lines.txt at 70 characters (or the nearest preceding space). If you leave off -s the lines will get cut in the middle of words. Most consoles are 80 columns wide and fold defaults to a width (-w) of 80 columns. This can also be useful in scripts where you need to display a paragraph of text with interpolated variables which you don't know the width of beforehand. Eg: echo -n "Enter some text: " read var para="You said, '$var'. That's really interesting. But \ do you know the answer to the ultimate question of life, \ the universe, and everything?"; echo $para | fold -s -w 78 - Regards -- Oliver Jones » Roving Code Warrior oliver(a)deeperdesign.com » +64 (21) 41 2238 » www.deeperdesign.com