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
Linear Programming Consider the following optimization problem: min x s.t. x ≥ max{a1, a2, . . . , an} Rewrite this problem as a Linear Programming Problem. What is the

question 1: In the opening lecture I spoke about general changes in business - flatter organizations, process orientation as opposed to functional silos, focus on supply chains, gr

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

Scenario A campsite provides cabins for travellers to stay in overnight. A 'cabin' is a small wooden hut, containing bunk beds, table and chairs, a heater, and a small cookin

Solve the following initial value problem y (3) - 5y'' - 22y' + 56 y= 0;       y(0) = 1;           y'(0) = -2;         y''(0) = -4 Solution : r 3 - 5r 2 - 22r + 56 = (

what is a microprocessor? types of microprocessors? advantages disadvantages

How does a program provide "input" to one of its functions?

While working in the eHealth Applied Research lab at Mohawk College, you are asked to transform an xml file into an XHTML representationusing XSLT for display in a browser.The xml

Problem: (i) Define Remote Procedure Call (RPC). (ii) Explain with diagram how RPC works? (iii) A remote procedure is uniquely defined by (a) Program number. (b)

Explain the applet Element ? Applets are embedded in web pages by using the and tags. The APPLET element is same to the IMG element. Like IMG APPLET references a source fil