Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the advantages of using shell scripts?

1072


What are the advantages of shell script?

1029


What is scripting autism?

1223


What is an inode block?

1064


Explain about return code?

1087


What will happen to my current process when I execute a command using exec?

1061


Write a script to print the first 10 elements of fibonacci series.

2351


How to print all array elements and their respective indexes?

969


Is shell a part of kernel?

1062


What is the purpose of scripting?

1090


Why do we write bin bash in shell scripts?

1026


What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?

1071


What does $$ mean in shell script?

1061


Is cmd a shell?

1031


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

1358