Wednesday, 19 June 2013

Write a shell script to check the length of a string?



echo “enter a string”
read a
X r = ` echo $ a | wc –c `
Y r = 1 expr $ r – l


OUTPUT:

Enter string
republic
8

No comments:

Post a Comment