## Wednesday, May 12, 2010

### Abbreviating output to a line in the terminal

A very long time ago, I quickly whipped together a Perl script that will reduce the standard output from another program to just a line, prefixed with an animation character, and optionally suffixed with ellipses if the line is too long. It is useful if only the most recent output is significant, and that I only want to know if the program is making progress. It can be applied to many commands, e.g.
• tar zxvf source-1.1.0.tar.gz | abbrev
• unzip archive.zip | abbrev
• make | abbrev
• tail -F /var/log/messages | abbrev
make abbrev