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

Explain about return code?

1089


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

1109


What does it mean to debug a script?

1066


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

1138


What is shell variable?

927


How do I debug a shell script?

1078


What is the conditional statement in shell scripting?

1243


determine the output of the following command: echo ${new:-variable}

994


What is shell terminal?

969


What are the different variables present in linux shell?

1118


What does $0 mean in shell script?

1021


What is the fastest scripting language?

1010


What is shell scripting used for?

1006


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

4076


What is the best shell scripting language?

1032