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 scripting and coding the same thing?
What is bash eval?
Why do we use shell scripting?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
How do I start a shell script?
What is the first line in a shell script?
How important is shell scripting?
What exactly is a shell?
Explain about the exit command?
Where are cowrie shells found?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
shell script for reverse the string
write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?
How do I read a .sh file?