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

What is gui scripting?

601


How to pass an argument to a script?

590


What does $@ mean in shell?

590


What is shift command in shell script?

522


What does $0 mean in shell script?

554






How can you get the value of pi till a 100 decimal places?

546


What are filters explain sort with all the options available?

930


Can you write a script to portray how set –x works?

550


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

526


What is the best scripting language?

562


How to print pid of the current shell?

598


What language is shell scripting?

579


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

656


What is shell terminal?

547


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

627