write a shell script to identify the given string is
palindrome or not?
Answer Posted / lekhrajdeshmukh
n=$1
a=0
b=0
while [ $n -gt 0 ]
do
b=$(( $n % 10 ))
a=$(( ($a * 10) + $b ))
n=$(( $n /10 ))
done
if [ $a -eq $1 ]
then
echo "$1 number is palindrome number"
else
echo "$1 is not an palindrome number"
fi
Is This Answer Correct ? | 56 Yes | 53 No |
Post New Answer View All Answers
Is powershell a bash?
What makes c shell a more preferable option than the bourne shell?
What is path in shell script?
Is bash an operating system?
Write down the syntax of "for " loop
What are the advantages of using shell scripts?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
How to debug the problems encountered in the shell script/program?
What is the first line in a shell script?
Is bash a shell script?
Why is the use of shell script?
What is the use of echo in shell script?
Given a file find the count of lines containing the word "abc".
What is the difference between bash and shell?
Why do we write bin bash in shell scripts?