write a shell script to identify the given string is
palindrome or not?
Answer Posted / gaurav shah
clear
echo enter a string
read a
b=`expr $a | wc -c`
b=`expr $b - 1`
echo number of letter=$b
while test $b -gt 0
do
e=`expr $a | cut -c $b`
d=$d$e
b=`expr $b - 1`
done
echo the reversed string is :$d
if test $a = $d
then
echo it is a palindrome
else
echo it is not a palindrome
fi
| Is This Answer Correct ? | 54 Yes | 21 No |
Post New Answer View All Answers
What is shell scripting?
how will you find the total disk space used by a specific user?
What is the best shell scripting language?
What is scripting autism?
What is the significance of the shebang line in shell scripting?
What does $@ mean bash?
How do I run a .sh file?
Is bash a shell script?
What is the lifespan of a variable inside a shell script?
c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again
What is the default shell of solaris?
What is path in shell script?
What is a shell environment?
Differentiate between ‘ and ” quotes.
Is shell a scripting language?