![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to print largest and smallest number. | amp10388 | UNIX for Dummies Questions & Answers | 2 | 05-07-2008 11:28 AM |
| How print number | bisla.yogender | Shell Programming and Scripting | 4 | 04-28-2008 07:51 AM |
| print or display certain number of file | jerardfjay | Shell Programming and Scripting | 2 | 04-05-2008 12:12 PM |
| to print number one less than actual number | cdfd123 | Shell Programming and Scripting | 4 | 09-06-2007 07:56 AM |
| How to print number of lines with awk ? | maheshsri | Shell Programming and Scripting | 1 | 11-18-2005 02:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
in Perl:
Code:
#!/usr/bin/perl
# count_letters.pl
use strict;
my %letters;
while (<>) {
chomp;
$letters{$_}++;
}
foreach my $letter (keys (%letters)) {
print "$letter = $letters{$letter} \n";
}
Code:
[ysawant@in-gcs-nas1 temp]$ perl count_letters.pl letters_file H = 3 N = 2 K = 4 L = 1 [ysawant@in-gcs-nas1 temp]$ |
![]() |
| Bookmarks |
| Tags |
| linux commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|