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 / dhyan@addiction

# PROGRAM TO FIND OUT WHETHER THE A INPUTED STRING IS
PALINDROME OR NOT.

echo -n "Please enter a string: "
read input_string
echo $input_string >> temp
reversed_string="$(rev temp)"
if [ $input_string = $reversed_string ]
then
echo -e "The string$input_string is palindrome\n"
else
echo -e "This string is not palindrome\n"
fi
rm temp #to use same file again and again

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best shell scripting language?

1023


Why is a script important?

1071


Given a file find the count of lines containing the word "abc".

1562


How to print the first array element?

1039


Is bash an operating system?

988


What is a shell environment?

998


What is sudo command?

1063


Is scripting and coding the same thing?

994


How are shells born?

971


Is shell scripting a language?

1047


What is option in shell script?

1018


How to check if the previous command was run successfully?

1045


What are the two files of crontab command?

1237


How will you find the 99th line of a file using only tail and head command?

2539


What are the 3 standard streams in linux?

1142