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
Is bash a shell script?
How to calculate the number of passed arguments?
How many fields are present in a crontab file and what does each field specify?
What is a shell? · Types of shell · what is shell scripting?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
What does egrep mean?
How to set an array in linux?
What does echo mean in scripting?
What are filters explain sort with all the options available?
Is shell scripting useful?
What can scripts do?
What does debug script mean?
How do you debug a script?
Explain about the slow execution speed of shells?
What is the use of "$#" in shell scripting?