Next | Welcome to my ~/bin | 13 |
#!/usr/bin/perl system("sort @ARGV | uniq -c | sort -n");
That's all
Note that if @ARGV is empty, it reads the standard input, as it should
Funny story about this program
For several months I had it wrong:
#!/usr/bin/perl system("sort | uniq -c | sort @ARGV");
This works fine when @ARGV is empty
Fails when files are specified
Because then the left sort hangs waiting for input
The right sort has already sorted the file
I didn't notice the missing -n either
uniq -c's output can be sorted either way:
9 63.164.145.33 10 208.49.6.42 86 6.0.3790.211 1155 158.130.12.194
Next | Menu | Copyright © 2005 M. J. Dominus |