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 mac default shell?
How to print all array elements and their respective indexes?
Print the 10th line without using tail and head command.
What's the difference between scripting and coding?
How will you connect to a database server from linux?
What are the two files of crontab command?
how will you find the total disk space used by a specific user?
How do you find out What is your shell?
What is the significance of $#?
What is computer cli?
Explain about sourcing commands?
What is shell scripting used for?
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
What is the significance of the shebang line in shell scripting?
What is a shell script? Can you name some of its advantages?