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
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Question 1 Discuss on UNIX kernel components 2 Explain process creation and process termination 3 When do a Deadlock occur? What are the Necessary Conditions for Deadlock

JavaScript is "Object Oriented" like C++ or Java. (Note that Java and JavaScript are not the same language, which is a common misconception) It also has variables, which makes Java

1. CMP and SUB CMP is used for comparing 2 registers by subtraction them from one another, but answer is not saved, whereas SUB subtracts 2 registers and saves the answer.

Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE

Question 1 How to call a WML Script from a WML Page? Question 2 Write short notes on WML Script Operators and Expressions Question 3 Write short notes on WML Script Statements

wat is- m=5; n=3; x=m++-n+++m;

This assignment will make use of arrays and functions to simulate a game. ASSIGNMENT DESCRIPTION This program will simulate part of the game of Yahtzee! The player will

We are looking for Pool Services Software Our company Pool Hands LLC is looking to build software for our internal use. We would like the software built therefore that it could