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
Print the 10th line without using tail and head command.
Explain about login shell?
How many fields are present in a crontab file and what does each field specify?
What is bash coding?
Explain about stdin, stdout and stderr?
What is $1 in shell scripting?
How do you create a shortcut in linux?
What is the first line of a shell script called?
What is the best shell scripting language?
What are the 3 standard streams in linux?
What happens on a system call?
Tell something about the super block in shell scripting?
What are the two files of crontab command?
What is the use of "$?" Sign in shell script?
What does $@ mean in shell?