≡ Menu

Count number of Charecter(s) present in a Line > Unix Shell Programming

You are Here: Home > Computer Subjects > Unix Shell Programming…

 

Count number of Charecter(s) present in a Line

Code:

clear

echo -n "Enter a Line==> "
read str

c=`echo $str | wc -c`
c=`expr $c - 1`

echo $c "Charecter(s) presents in this line..."

Optput:

Enter a Line==> Unix Programming
16 Charecter(s) presents in this line…

 

Click Here to Find Latest Jobs and Current Affairs