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

Is bash a shell script?

1010


How to calculate the number of passed arguments?

1012


How many fields are present in a crontab file and what does each field specify?

1070


‎What is a shell? · ‎Types of shell · ‎what is shell scripting?

934


one folder contains lot of students name but I want to fetch hello with every student name individually using shell script

913


What does egrep mean?

922


How to set an array in linux?

1137


What does echo mean in scripting?

961


What are filters explain sort with all the options available?

1288


Is shell scripting useful?

1003


What can scripts do?

1057


What does debug script mean?

928


How do you debug a script?

1016


Explain about the slow execution speed of shells?

1171


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

1002