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 / gaurav shah

clear
echo enter a string
read a
b=`expr $a | wc -c`
b=`expr $b - 1`
echo number of letter=$b
while test $b -gt 0
do
e=`expr $a | cut -c $b`
d=$d$e
b=`expr $b - 1`
done
echo the reversed string is :$d
if test $a = $d
then
echo it is a palindrome
else
echo it is not a palindrome
fi

Is This Answer Correct ?    54 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get script name inside a script?

973


What is shell variable?

868


What is shell scripting used for?

945


Write a shell script to get current date, time, user name and current working directory.

1041


What is the significance of the shebang line in shell scripting?

1064


What is option in shell script?

972


How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?

1064


What are the default permissions of a file when it is created?

967


What is shell and shell script?

1082


What are scripts in psychology?

1002


What is the first line in every perl script called?

994


Is shell scripting a programming language?

1013


Tell something about the super block in shell scripting?

981


Suppose you execute a command using exec, what will be the status of your current process in the shell?

1031


What are types of shells?

982