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

Print the 10th line without using tail and head command.

2168


Explain about login shell?

1112


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

1110


What is bash coding?

918


Explain about stdin, stdout and stderr?

1167


What is $1 in shell scripting?

1034


How do you create a shortcut in linux?

1184


What is the first line of a shell script called?

1077


What is the best shell scripting language?

1013


What are the 3 standard streams in linux?

1126


What happens on a system call?

1005


Tell something about the super block in shell scripting?

1023


What are the two files of crontab command?

1221


What is the use of "$?" Sign in shell script?

1166


What does $@ mean in shell?

1031