![]() |
|
|
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 |
| simple shell - how to get a parameter typed in a shell script | cmitulescu | Shell Programming and Scripting | 4 | 01-09-2009 08:45 PM |
| Help need to make a shell script run for ffmpeg vhook watermaking in shell | wingchun22 | Shell Programming and Scripting | 1 | 09-27-2008 07:52 AM |
| How to Start a Shell as Login shell instead of ordinary shell | Sivaswami | Linux | 3 | 07-01-2008 02:52 PM |
| Difference between writing Unix Shell script and AIX Shell Scripts | haroonec | AIX | 0 | 04-12-2006 03:27 AM |
| How to run unix commands in a new shell inside a shell script? | hkapil | Shell Programming and Scripting | 2 | 01-04-2006 06:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
C-Shell
Hi All,
I need a script for the C-shell. It is used as follows: The script is run on the command line and three command line arguments are specified: a filename and two letters. The script reads the file and analyzes it: For each letter from the first to the second it determines how ofter the letter occurs in the file and prints this. Example: The user types?? scr poem b h The script analyzes the file poem for the letters from b to h and prints the result in the form shown below: ?b?? c?? d?? e?? f?? g?? h ========================== 23? 12? 55? 17? 16?? 8?? 5 The letters have a distance of 3 spaces from each other, the line stretches from the first to the last letter, the numbers are exactly under the letters. Programming hints: 1) Put the file contents in a local shell variable 2) Remove all spaces (tr command) 3) Make all letters lower case (tr command) 4) Remove all characters that are not letters from a to z. 5) For each letter in the specified range find their frequencies. 6) Print the letters in the range 7) Print a line of '=' of the exact length 8) Print the numbers under the letters Thanks in advance. |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|