Write a shell script to to run check on strings which includes whether strings are equal or not and whether the size of the strings greater than zero or not.
Accept Two Strings from User on Terminal then first check Strings whether given string empty or not using [ -z $stringname ] it will return 1 if strings are empty after that we can compare this two strings using = operator .
#Program to check String Related Operations
#Program From Nullpointer.in
echo "Enter First String"
echo "Enter Second String"
if [ -z $strf ] || [ -z $strs ]; then
echo "Strings Should Not be Empty...!!!!"
elif [ "$strf" = "$strs" ]; then
echo "Given Strings are Same....!!!!"
echo "Given String are Not Equal....!!!"