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 powershell a language?

984


How to print all the arguments provided to the script?

910


How do I run a bin bash script?

972


What does chmod do?

1072


How to get the last line from a file using just the terminal?

1152


What is bash eval?

938


What does egrep mean?

913


What is the command to find out today's date?

1083


what is tickets $ what low,medium,high priorite pls define time also

2093


Why is the use of shell script?

936


Write the syntax for "if" conditionals in linux?

1052


How can I set the default rwx permission to all users on every file which is created in the current shell?

1374


What is the use of .sh file?

1053


When should shell programming/scripting not be used?

1082


What is inside a seashell?

1073