#!/usr/bin/env perl # start a mailq process, but transform the output into something that # can be grepped open MAILQ, "mailq|"; while (){ s/\*\*\*.*//; if (m/^\n/){ print "\n"; } else { chomp; s/\s+/ /g; print; } }