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 the use of echo in shell script?

542


What does $@ mean bash?

664


How will you find the 99th line of a file using only tail and head command?

1983


How do you know which shell I am using?

587


What language is shell scripting?

579






What is the conditional statement in shell scripting?

657


Write a script to print the first 10 elements of fibonacci series.

1766


What language is bash written in?

560


Which shell is the best?

574


How will you copy a file from one machine to other?

544


Write down the syntax for all the loops in shell scripting.

659


What is shell prompt?

560


What is another name for a bash shell script that you might see?

1010


How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?

716


How to debug the problems encountered in the shell script/program?

626