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

Answer Posted / sathya

echo "enter a string"
read str
rev=`expr $str|rev`
if [ $rev = $str ]
then
echo "the given string is palindrome"
else
echo "the given string is not palindrome"
fi

Is This Answer Correct ?    20 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get the first line from a file using just the terminal?

595


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

636


Explain about non-login shell files?

692


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

3587


What is a batch file used for?

558






What are the different variables present in linux shell?

610


Is scripting and coding the same thing?

559


How to print all array elements and their respective indexes?

501


What is the default shell of solaris?

567


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

752


How do you find out What is your shell?

590


What is a shell script? Can you name some of its advantages?

525


How do I run a script from command prompt?

560


Which scripting language is best for automation?

528


What is ms powershell?

581