Package: moreutils Version: 0.47 Severity: wishlist Hi,
I've often wondered why there is no equivalent to "wc" which counts input byte that will simply add up the numbers it gets fed. Examples would be adding up file sizes, "wc -l" output, or whatever numbers some shell pipe produces. The attached "add" program is trivial (I don't even claim any copyrightable content), but useful. Please consider including it in moreutils. Christoph -- c...@df7cb.de | http://www.df7cb.de/
#!/usr/bin/perl use strict; use warnings; my $sum = 0; while (<>) { next if /^\s*$/; $sum += $_; } print "$sum\n";
signature.asc
Description: Digital signature