The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-05-2008
saravin24 saravin24 is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 5
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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0