forked from alhazred/solaris-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrap.pl
40 lines (35 loc) · 866 Bytes
/
crap.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl -lan
##
##
######################################################################
## Just a nothing script that counts the recurrence of letters from stdin.
## Written 000630 -Ed Arizona
##
## usage: cat /text-file | ./crap.pl
##
## Questions or problems? [email protected]
## Visit the unix archive at http://www.arizonaed.com/unix
## Check out the long list of links, http://www.arizonaed.com/unix/urls.html
##
## Please feel free to email me about possible job opportunities in
## the NY/NJ/PA area.
##
######################################################################
for ($i=0; $i<=length($_); $i++)
{
$hash{lc(substr($_,$i,1))}++
}
END {
foreach $key (sort keys %hash)
{
printf "%d: %s\n",$hash{$key},$key;
}
###
# show all keys at end
###
##foreach $key (sort keys %hash)
##{
## printf "%s",$key;
##}
##print;print;
}