Shell script to count of five character words, Programming Languages

Shell Script  to Count of five character words

 

Program

 

  W.A.S.S. to count of five character words.

#07MCG20

 

cnt=0

for w in `cat good.sh`

do

len=`echo $w | wc -c`

len=`expr $len - 1`

if test $len -eq 5

then

cnt=`expr $cnt + 1`

fi

done

echo "Total words of length file are : $cnt"

 

Output

 

Total words of length file are : 3

Posted Date: 9/26/2012 8:07:25 AM | Location : United States







Related Discussions:- Shell script to count of five character words, Assignment Help, Ask Question on Shell script to count of five character words, Get Answer, Expert's Help, Shell script to count of five character words Discussions

Write discussion on Shell script to count of five character words
Your posts are moderated
Related Questions
Below is an example of an invalid XHTML page. Your goal is to rewrite the code so that: No deprecated/obsolete tags are being used All elements are nested correctly (i.e

Write three functions, statistics, average, and sD as follows. The statistics function returns no value and has six parameters: four scores followed by their average and standard d

hi, can you help me with testing java classes I have wrote using java and jsp and servlet in eclipse ? I want to use JUnit for testing

Have the user input two values. Store them in variables called savings and expenses, both of data type double. If expenses is less than savings, subtract expenses from savings, o

Create a logical expression that corresponds to the following statement: If you like talking about computers or playing video games at LAN parties, and you want to meet others w

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Assigment 01 Subject Code: ITE 2106 Subject Name: Software Engineering You run a software development organization catering to external clients to build software solutions. The bus

#question.what. is cai? Explain its pitfalls .o

i have to make a program that encrypt a text to numbers, i don''t know what is wrong in my code, the example of what i need: text: hi >> number: 17 23

The following function calls supposedly write a single new-line character, but some are incorrect. Identify which calls don't work and explain why.     printf("%c", '\n');