loader image

Shell script to reverse a string and check whether a given string is palindrome or not

Aim: Write a shell script to reverse a string and check whether a given string is palindrome or not

echo Enter the string
read s
echo $s>temp
rvs="$(rev temp)"
if [ $s = $rvs ]
then
echo "it is palindrome"
else
echo " it is not a Palindrome"
fi
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top