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 bash coding?

497


How to calculate the number of passed arguments?

552


How will you print the login names of all users on a system?

570


What command needs to be used to take the backup?

528


What are the different variables present in linux shell?

610






What is a shell made of?

555


What is a batch file used for?

558


Is shell scripting a programming language?

574


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

626


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


Explain about login shell?

633


Where are cowrie shells found?

574


How many fields are present in a crontab file and what does each field specify?

580


How can you find out how long the system has been running?

526


Why do we write bin bash in shell scripts?

546