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
How to check if the previous command was run successfully?
What does $@ mean in shell?
How to print pid of the current shell?
What happens on a system call?
What is the first line in a shell script?
What will happen to my current process when I execute a command using exec?
Explore about environment variables?
What is shell and terminal?
Where is bash history?
How do I open a jshell in cmd?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
What is shell company all about?
What are the advantages of using shell scripts?
What can you do with powershell?
What are the disadvantages of shell scripting?