code cleanup with explicit readline loop
[minime.git] / termimg
1 #!/bin/sh
2 convert -compress none -resize 66x23 - pgm:- |
3 perl -e '
4 <> eq "P2\n" or die "ascii pgm input required\n";
5 <>; <>;  # ignore depth, dimensions
6
7 my @ch = split //, " .oO@";
8 while (<>) {
9         print $ch[ $_ * @ch >> 8 ] for /\d+/g;
10         print $/;
11 }
12 '