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

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

Posted Date: 9/26/2012 8:05:39 AM | Location : United States







Related Discussions:- Shell script to count characters,words and lines from a file, Assignment Help, Ask Question on Shell script to count characters,words and lines from a file, Get Answer, Expert's Help, Shell script to count characters,words and lines from a file Discussions

Write discussion on Shell script to count characters,words and lines from a file
Your posts are moderated
Related Questions
Introduction A search engine (like Google) has three main components: a crawler that finds and stores copies of files on the web, an indexer that creates a data structure that

Problem: (i) All Security authentication mechanism that run on the TRU64 Unix Operating system run under the Security Integration Architecture ( SIA ) layer. Explain with diag

What is .NET TECHNOLOGY? .NET technological innovation was presented by Enthusiasm, to get the industry from the SUN's Coffee. Few in the past, Enthusiasm had only VC++ and VB

Version Control is a critical tool in development and production environments that allows a user to make snapshots of working con?gurations or code. In this assignment, you will de

how can we get the data from data base to combo box in jsp page dynamically

I am getting error at business layer object in code behind page.

Vacation Envy - Travel and Photo Sharing Website Site Overview- Vacation Envy is a travel as well as photo-sharing site. Make your travel map, share photos and show off al

We need help for build a Price Quote Generator I am interested in two things (A) a web based system that will allow a user to enter the parameters of their contests (there are o

How and where to start to develop a preprocessor for java

The assignment has two parts: first you generate a simple application for a MID that operates independently of other MIDs. As a second part, the application is extended to keep so