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

What happens when you type ls?

1038


What is wc in shell script?

1023


What does $@ mean in shell?

1086


What is another name for a bash shell script that you might see?

1508


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

1066


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

2210


Explain about shebang?

1086


Can we run shell script in windows?

1208


What happens on a system call?

1069


How do I open the shell prompt?

1242


What is path in shell script?

1141


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

4183


What is a shell script in windows?

1142


is this growing field and what is average package in this?

2343


Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

1321