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

How to check if the previous command was run successfully?

1087


What does $@ mean in shell?

1086


How to print pid of the current shell?

1041


What happens on a system call?

1071


What is the first line in a shell script?

1167


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

1127


Explore about environment variables?

1098


What is shell and terminal?

1048


Where is bash history?

988


How do I open a jshell in cmd?

1318


madhar chod unix ke 10 commands dhang se likh nahi sakta hai

3520


What is shell company all about?

1031


What are the advantages of using shell scripts?

1111


What can you do with powershell?

1191


What are the disadvantages of shell scripting?

1263