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 does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?

1054


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

977


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

4065


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2464


What are the advantages of shell scripting?

1031


What is a scripting language simple definition?

1086


What does $1 mean in bash?

1085


What is a shell script in windows?

1080


What is shell and shell script?

1111


What are the 3 standard streams in linux?

1126


How to print all array elements and their respective indexes?

951


How many fields are present in a crontab file and what does each field specify?

1108


How do I debug a shell script?

1065


Explain about the slow execution speed of shells?

1215


What is an sh file?

929