Saturday, 8 March 2014

write a Unix program to count the number of characters in a given string.



write a Unix program to count the number of characters in a given string.

clear
echo "Enter the String to find the length"
read st
l=`echo $st | wc -c`
echo "Length of the string is `expr $l - 1`"

OutPut

Enter the String to find the length
Jaisha
Length of the string is 6

No comments: