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 the syntax of "nested if statement" in shell scripting?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
Explain about login shell?
What are the four fundamental components of every file system on linux?
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
Why do we use shell scripting?
What language is bash?
What's the difference between scripting and coding?
What is difference between shell and bash scripting?
How do I save a powershell script?
Write a shell script to get current date, time, user name and current working directory.
What can you do with powershell?
What does $@ mean in shell?
Explain about the exit command?
What is shell scripting?