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 is the conditional statement in shell scripting?

1159


What is the best shell scripting language?

947


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

2139


What is meant by $1 in shell script?

902


What is the default shell of solaris?

997


What is path in shell script?

1020


What is the use of break command?

1036


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

4014


Explain about echo command?

1039


Explain about login shell?

1051


What are the advantages of shell script?

963


Is shell scripting useful?

989


What is $1 in shell scripting?

980


What are filters explain sort with all the options available?

1279


What are different types of shell?

874