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
What is echo $shell?
Why should we use shell scripts?
How important is shell scripting?
How to print all the arguments provided to the script?
What are zombie processes?
What is web script?
What is the default ubuntu terminal?
Why is the use of shell script?
What is subshell?
How to debug the problems encountered in the shell script/program?
Where are cowrie shells found?
What is the fastest scripting language?
How do I run a script from command prompt?
What does echo $0 do?
What does .sh file contain?