Your Only Destination To Empower Your Computer Programing Knowledge. Sky is not so high, You can Touch it if You Try

Script for calculating characters,words and lines in a fil

echo "Enter the file name"
read a
echo
echo Contents of file are:-
cat $a
echo
echo "Number of lines in given file"
wc -l $a
echo
echo "Number of words in given file"
wc -w $a
echo
echo "Number of characters in given file"
wc -c $a
~
~
~
~
~
~
~
~
~
~
~
"wc" 12L, 275C


Output:-

Enter the file name
pa

Contents of file are:-
jiska koi nhi uska khuda hai yaro

Number of lines in given file
1 pa

Number of words in given file
7 pa

Number of characters in given file
34 pa

No comments:

Post a Comment