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 command needs to be used to take the backup?
What is awk in shell scripting?
What is sudo command?
How to get the 3rd element/column from each line from a file?
What is another name for a bash shell script that you might see?
What is the first line of a shell script called?
Which shell is the best?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
What is shell environment?
Is shell scripting easy to learn?
What is @echo off?
Why are shell scripts used?
What does it mean to debug a script?
How do I run a script on mac?
What are script files?