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 in a script?
What is sed in shell script?
How do you create a shortcut in linux?
Write the syntax for "if" conditionals in linux?
What is .sh file in mac?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
How to print pid of the current shell?
How do we create command aliases in a shell?
What is the use of .sh file?
How do I read a .sh file?
Write down the syntax for all the loops in shell scripting.
How will you connect to a database server from linux?
How do I run a .sh file on mac?
What is the syntax of "nested if statement" in shell scripting?
How do I open the shell prompt?