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
What is a command line shell?
How to redirect both standard output and standard error to the same location?
What is the command to find out users on the system?
What language is shell scripting?
How do I run a script from command prompt?
I have 2 files and I want to print the records which are common to both.
What are filters explain sort with all the options available?
What are the zombie processes?
How are shells born?
What is the default shell of solaris?
Explain about echo command?
Calculate a real number calculation directly from the terminal and not any shell script.
Is shell a part of kernel?
shell script for reverse the string
What is the use of "$#" in shell scripting?