Laynetworks  
Web laynetworks.com Google
Home | Site Map | Tell a friends
Management Tutorials
Download
Tutorials
History
Computer Science
Networking
OS - Linux and Unix
Source Code
Script & Languages
Protocols
Glossary
IGNOU
Quiz
About Us
Contact Us
Feedback
 
Sign up for our Email Newsletter
 
Get Paid for Your Tech Turorials / Tips

 

 

Home > Source Code > Shell Script
Page : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Shell Script
 

Shell script to check whether a String is Palindrome or not?

This Shell Script is developed using Bourne Shell.

1=0
cnt=1
tag=0
echo "Enter a String?"
read str
1 =`echo $str |wc -c`
1 =`expr $l - 1`
1h=`expr $l / 2`
while [ $cnt -le $lh ]
do
c1=`echo $str|cut -c$cnt`
c2=`echo $str|cut -c$l`
if [ $c1 != $c2 ]
then
cnt=$lh
tag=1
fi
cnt=`expr $cnt + 1`
=`expr $l - 1`
done
if [ $tag -eq 0 ]
then
echo "String is Palindrome"
else
echo “String is not Palindrome”
fi

 
Page : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 
Donation | Useful links | Link to Laynetworks.com | Legal | SharePoint Development
Copyright © 2000-2010 Lay Networks All rights reserved.