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

How do I debug a shell script?

1124


What is shell and terminal?

1048


What is a command line shell?

1105


How to write a function?

1073


How do I set bash as default shell mac?

1051


What is the use of break command?

1163


How do I run a script from command prompt?

1137


What will happen to my current process when I execute a command using exec?

1127


What is batch file programming?

1201


What is a shell made of?

1002


How can I set the default rwx permission to all users on every file which is created in the current shell?

1472


What is echo $shell?

1129


What does echo $0 do?

1022


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

1440


Print the 10th line without using tail and head command.

2218