Shell script to count of five character words, Programming Languages

Assignment Help:

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


Related Discussions:- Shell script to count of five character words

Matlab error, n2=2:100; t=3; while t { g3(t)=(1/2)*(0.63)*(0.8....

n2=2:100; t=3; while t { g3(t)=(1/2)*(0.63)*(0.8.^(n2)); t=t+1; } g3(1)=0; g3(2)=0; what is wrong with the code above? it tells me that line: g3(t)=(1/2)

Program to calculate the triangle area, Write a program that will allow the...

Write a program that will allow the user to input the corners of a triangle. The program will draw small yellow circles for each input point, then draw the triangle and calculate t

Write a program to read a text file and create a dictionary, Write a progra...

Write a program to read a text file and create a dictionary. The keys for the dictionary should be all 26 letters of the alphabet and the values of the dictionary should be the lis

Write a perl script to assign letter grades to the students, Tasks: Writ...

Tasks: Write a Perl script assignGrades.pl to assign letter grades to the students. Please use the classList2.txt file. Upon invoking, the script will access the file classL

Input output program, Problem Specification I/O programming is the \bre...

Problem Specification I/O programming is the \bread and butter", the raison d'etre, of microcontrollers. After all, our definition of a microcontroller is \a microprocessor wit

Write a perl script that prints the contents of a file, Write a Perl script...

Write a Perl script that prints the contents of a file Write a Perl script that prints the contents of a file, prefixing each line with a line number. The script should acc

Special matrices, Special Matrices There are some "special" matrices o...

Special Matrices There are some "special" matrices out there which we may use on occasion. The square matrix is the first special matrix.  A square matrix is any matrix that s

Solve the given initial value problem, Solve the following initial value pr...

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 = (

Hack winrar password, how to make a program using vb?seriously i don''t kno...

how to make a program using vb?seriously i don''t know

Prolog predicate for list that contains duplicate elements, Write a Prolog ...

Write a Prolog predicate  has_duplicates(L)  that is true if list  L  contains duplicated elements (that is at least 2 copies of an element). For instance: ?- has_duplicates([a,

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd