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 / prasath

echo"to check whether given string is palindrom or not"
echo"Enter the string"
read str
Len=$(echo "$str"| wc -c
while [$len -gt 0]
do
ch=$(echo "$str"| cut -c $len)
echo -n "$ch"
s1=$s1$ch
Len =`expr $len -1`
done
echo""
if [$s1 != $str]
Then
echo "Tha string is not palindrom"
else
echo"The string is palindrom"
fi

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by $1 in shell script?

951


How to print all array elements and their respective indexes?

968


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

1156


What is a program shell?

1047


Determine the output of the following command: name=shubham && echo ‘my name is $name’.

985


What is option in shell script?

1018


How do I open the shell prompt?

1197


How do I set bash as default shell mac?

1010


How to print all the arguments provided to the script?

962


What does $@ mean bash?

1175


When should shell programming/scripting not be used?

1154


What is bash eval?

1015


What command needs to be used to take the backup?

990


What is the way to do multilevel if-else's in shell scripting?

1301


Write down the syntax for all the loops in shell scripting.

1141