write a shell script to identify the given string is
palindrome or not?

Answer Posted / prasath

echo"to check whether given string is palindrom or not"
echo"Enter the string"
read str
Len=$(echo "$str"| wc -c
while [$len -gt 0]
do
ch=$(echo "$str"| cut -c $len)
echo -n "$ch"
s1=$s1$ch
Len =`expr $len -1`
done
echo""
if [$s1 != $str]
Then
echo "Tha string is not palindrom"
else
echo"The string is palindrom"
fi

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are types of shells?

547


What is the first line in every perl script called?

551


What is shell geeksforgeeks?

593


Why is the use of shell script?

542


What does chmod do?

573






What is a shell script in windows?

585


What is option in shell script?

558


Is shell scripting easy to learn?

567


How will you pass and access arguments to a script in linux?

583


What is bash eval?

547


What are the advantages of using shell scripts?

582


How do I open a jshell in cmd?

596


Give some situations where typing error can destroy a program?

722


Where are cowrie shells found?

574


What does it mean to debug a script?

570