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 / onkar

# Check wheather given number is Palindrome or Not ?
# for ex- 121 -palindrome ,123 -Not palindrome

echo "Enter Number\n"
read no
n1=$no
rev=0
while [ $n1 -ne "0" ]
do
rem=`expr $n1 % "10"`
n1=`expr $n1 / "10"`
rev=`expr $rem + $rev \* "10"`
done
if [ $no -eq $rev]
then
echo Palindrome
else
echo Not Palindrome
fi

Is This Answer Correct ?    14 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is shell terminal?

897


What are the four fundamental components of every file system on linux?

1614


What is shell scripting?

983


Is cmd a shell?

954


Write a command sequence to find the count of each word?

939


What is the use of echo in shell script?

946


How do I open the shell in cmd?

1043


What is subshell?

870


Determine the output of the following command: name=shubham && echo ‘my name is $name’.

929


What is an inode block?

992


I want to connect to a remote server and execute some commands, how can I achieve this?

972


What is option in shell script?

950


What is shell company all about?

928


How do you find out What is your shell?

1002


What are different types of shell?

876