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

Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

1144


What is subshell?

934


What is the first line of a shell script called?

1070


What is mac default shell?

1088


Is shell scripting a programming language?

1037


How to find all the files modified in less than 3 days and save the record in a text file?

1050


What is the use of echo in shell script?

1003


What is a shell script? Can you name some of its advantages?

1049


What exactly is a shell?

1064


What are the different types of variables used in shell script?

1045


What is scripting used for?

1035


What is shell company all about?

974


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

2200


What is sed in shell script?

1037


write a shell script to check the failed jobs?

4396