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

Answer Posted / kirtiranjan sahoo

read -p "Enter a string : " st
rvs=`echo $st | rev`
if [ $st == $rvs ]
then
echo "Palindrome"
else
echo "Not Palindrome"
fi

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a shell environment?

572


How will you emulate wc –l using awk?

904


How to set an array in linux?

591


I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.

593


What are different types of shell?

487






I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

752


How do I read a .sh file?

529


Write a shell script to get current date, time, user name and current working directory.

627


How do you know which shell I am using?

587


What does $1 mean in bash?

612


What is the best scripting language?

562


How to write a function?

592


What are the various stages of a linux process it passes through?

624


How do you find out What is your shell?

588


What does the sh command do?

604