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 happens on a system call?

1017


Why is it called a shell?

934


What is ms powershell?

1024


What is the best shell scripting language?

1024


Is powershell a bash?

1082


What is the use of "$#" in shell scripting?

1072


What does debug script mean?

983


What is shell and shell script?

1121


What is bash used for?

1013


Is cmd a shell?

1029


How will you pass and access arguments to a script in linux?

1158


What is shell scripting used for?

999


What language is used in terminal?

987


What are the four fundamental components of every file system on linux?

1685


How to print the first array element?

1039