Shell script to count characters,words and lines from a file, Programming Languages

Assignment Help:

W.A.S.S to print the following:

                              i.        Count of characters, words and lines from a file.

                            ii.        Count of five character words.

       iii.     Convert all lower case characters to upper case.

 

Program

 

#W.A.S.S. to Count of characters, words and lines from a file.

 

echo -e "Total character in the file are: \c"

cat good.sh |wc -c

echo -e "Total words in the file are: \c"

cntw=0

 

for w in `cat good.sh`

do

cntw=`expr $cntw + 1`

done

 

echo "$cntw"

echo -e "Total lines in the file are : \c"

cat good.sh |  wc –l

 

Output

 

Total character in the file are:     162

Total words in the file are: 27

Total lines in the file are :      15


Related Discussions:- Shell script to count characters,words and lines from a file

String cost, A string S is said to be "Super ASCII", if it contains the cha...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Retrive unicode text using vb.net ado.net, How Can I Retrive Unicode CSV Fi...

How Can I Retrive Unicode CSV File the ADO.net VB.net

Unix help, need a command to : Display user id, first and last names of all...

need a command to : Display user id, first and last names of all the students the class specified by the prefix in alphabetical order by last name from /etc/passwd

Developing a preprocessor for java, How and where to start to develop a pre...

How and where to start to develop a preprocessor for java

C++ language introduces, C++ language introduces object-oriented programmin...

C++ language introduces object-oriented programming (OOP) features to C language. It offers classes, which provide the four features commonly present in OOP (or some non-OOP) langu

Explain the while statement - computer programming, Explain the While State...

Explain the While Statement - Computer Programming? A 'while statement' is an entry controlled loop statement. When the expression is calculated and the condition is not satisf

Produce a hierarchy chart-a structured flowchart, Produce a hierarchy chart...

Produce a hierarchy chart, a structured flowchart, and a Pascal program (with appropriate comments) to generate the Sales Commission Report shown below. The commission for each sal

Russian peasant, This is Python program I am stuck Modify the Russian peas...

This is Python program I am stuck Modify the Russian peasant multiplication mod n function from class to perform "Russian peasant exponentiation" instead. You can assume that you

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