This is my super-simple progress indicator, called dots. I wrote it at least 12 years ago when I was on a slow terminal and wanted to know unpacking a tarball was still progressing (the verbose output would have taken too much bandwidth!). Now I copy it onto every new system I use.
It prints one period (.) for every 1000 lines of text piped into it. It just shows that there is still activity, not progress, but often this is enough.
A typical usage is:
tar xvfz some_huge_tarball.tar.gz | dots
It defaults to one dot per 1000 lines, but the first argument can be a number to specify another interval. #!/usr/bin/perl
$| = 1;
$i = 0;
if ($#ARGV < 0) {
$number = 1000;
} else {
$number = shift(@ARGV);
}
while (<STDIN>) {
print '.' unless ($i % $number);
$i++;
}
print "\n";