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 / akshay telang

#! /usr/bin/ksh
string=$1
str1=$1
pal=""
typeset -R1 last

while ((${#string})) ; do
last=$string
pal=${pal}${last}
if ((${#string} > 1)) ; then
typeset -L$((${#string}-1)) oneLess=$string
string=$oneLess
else
string=
fi
done
if [ "$str1" == "$pal" ]
then
echo "String is a Palindrome"
else
echo "String is not a Palindrome"
fi

Is This Answer Correct ?    24 Yes 28 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is awk script?

971


How do I read a .sh file?

1101


What is computer cli?

893


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

4121


Explain about "s" permission bit in a file?

1053


State the advantages of shell scripting?

1047


Can shell script run on windows?

1056


How do I open a jshell in cmd?

1234


How do scripts work?

1034


Explain about stdin, stdout and stderr?

1168


How to print all the arguments provided to the script?

952


Can you write a script to portray how set –x works?

995


What language is bash?

916


how will you find the total disk space used by a specific user?

1045


What is the conditional statement in shell scripting?

1227