Google Search

Thursday, October 6, 2011

Write a shell script which counts the number of lines and words present in a given file.


Write a shell script which counts the number of lines and words present in a given file.  


echo Enter a file name:
read fn
echo Number of Lines:
wc –l $fn
echo Number of Words:
wc –w $fn
echo Number of Characters:
wc –c $fn

0 comments:

Post a Comment