Write a shell script to test the length of string is zero or not. 

echo "Enter any string"
read str

len=`echo $str | wc -c`

if [ $len -eq 1 ]
then 
	echo "Length of string is zero"
fi

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *