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 happens when you type ls?
What is wc in shell script?
What does $@ mean in shell?
What is another name for a bash shell script that you might see?
What are the default permissions of a file when it is created?
what is tickets $ what low,medium,high priorite pls define time also
Explain about shebang?
Can we run shell script in windows?
What happens on a system call?
How do I open the shell prompt?
What is path in shell script?
write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?
What is a shell script in windows?
is this growing field and what is average package in this?
Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.