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 are the disadvantages of shell scripting?
What is gui scripting?
What is an inode block?
How does shell scripting work?
Write down the syntax of "for " loop
What are the various stages of a linux process it passes through?
How to print pid of the current shell?
What makes c shell a more preferable option than the bourne shell?
what is info area how many types?
What is awk in shell script?
c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command
How do I save a powershell script?
What does sh mean?
What is the meaning of $1 in shell script?
What language is bash?