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

Is scripting and coding the same thing?

950


What is bash eval?

958


Why do we use shell scripting?

953


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

1121


How do I start a shell script?

1151


What is the first line in a shell script?

1048


How important is shell scripting?

1006


What exactly is a shell?

1028


Explain about the exit command?

941


Where are cowrie shells found?

974


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

1038


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

4032


shell script for reverse the string

1362


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

4079


How do I read a .sh file?

1053