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

program that uses a hash structure, Write a Perl program that uses a hash ...

Write a Perl program that uses a hash structure. The program should use a larger number of operations (100 or more) on this hash. To do that, use a random number generator to creat

Develop an application for airraid game, Extend the AirRaid game, so that t...

Extend the AirRaid game, so that the planes drop a bomb on the gun as they go over it. The gun has to move out of the way otherwise it will be destroyed if hit. Provide three lives

Provide example of function, Provide Example of Function? An illustrati...

Provide Example of Function? An illustration of a function definition main() { message(); } /* header */ message() { /*bodystarts here*/ printf ("Example for function

I have to create three batch files, I have to create a bank atm machine usi...

I have to create a bank atm machine using MS-DOS. I am struggling to create LIST ALL ACCOUNTS ROLL-BACK TRANSACTIONS ACCESS AN ACCOUNT

C# xna game project, I am working on a game project using C# XNA. I only h...

I am working on a game project using C# XNA. I only have two weeks from the deadline. Would you help me to finish it up? Please let me know as soon as possible. Thanks, Sophi

Visual basic 2010, I have to create a calorie counter and I am totally lost...

I have to create a calorie counter and I am totally lost

Implement a lunar lander simulation, 1. Modify your solution to #8 so that ...

1. Modify your solution to #8 so that if an ellipse is touched by the mouse, it turns permanently green.Bonus (up to +5): a green ellipse stops moving, but recovers after 5 seconds

Implement a two-dimensional table in prolog, Implement a two-dimensional ta...

Implement a two-dimensional table in Prolog. Your program will contain: An insert_entry predicate that takes a table, row, column and an entry and inserts the entry at the g

C# XNA Game Development, I need help for C# XNA 2Dimension Game Development...

I need help for C# XNA 2Dimension Game Development. I am gonna send the question and my solution(incomplete). I need you to complete it. Can you help me about that. I have 6-7 days

Shell script to check whether user has logged in or not, Normal 0 ...

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

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