Question:
String length is empty or not
Answer:
#!/usr/bin/bash
mystring="I love my country"
if [ -z "${mystring}" ]
then
echo "mystring length is not zero"
else
echo "$mystring"
fi
Output:
kalam@DESKTOP-OSJTLNE:~$ sh string_length_zero_or_not.sh
I love my country
No comments:
Post a Comment