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 / abhijeet chavan (cts)

set -x
input_string=$1
if [ -z "$input_string" ] ; then
echo "Please enter a Text along with the script name\n"
exit
fi

reversed_string=$(rev $input-string)
if [ "$input_string" -eq "$reverse_string" ] ; then
echo "The String $input_String is a Palindrome"
else
echo "This string is not a palindrome"
fi

Is This Answer Correct ?    49 Yes 51 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is basename in shell script?

1062


How to write a function?

1043


What are script files?

1040


How do I open the shell in cmd?

1150


Can shell script run on windows?

1078


What are the 3 standard streams in linux?

1149


Is cmd a shell?

1033


Why are shell scripts used?

1087


Why is the use of shell script?

984


What is $1 in shell scripting?

1051


What is the significance of $#?

1113


Which is better perl or shell scripting?

1000


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

1157


What is sudo command?

1069


What is the syntax of "nested if statement" in shell scripting?

1105