write a shell script to identify the given string is
palindrome or not?
Answer Posted / onkar
# Check wheather given number is Palindrome or Not ?
# for ex- 121 -palindrome ,123 -Not palindrome
echo "Enter Number\n"
read no
n1=$no
rev=0
while [ $n1 -ne "0" ]
do
rem=`expr $n1 % "10"`
n1=`expr $n1 / "10"`
rev=`expr $rem + $rev \* "10"`
done
if [ $no -eq $rev]
then
echo Palindrome
else
echo Not Palindrome
fi
| Is This Answer Correct ? | 14 Yes | 16 No |
Post New Answer View All Answers
When should shell programming/scripting not be used?
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 can I send a mail with a compressed file as an attachment?
Is powershell a language?
What are "c" and "b" permission fields of a file?
What is path in shell script?
What are the types of script?
what is info area how many types?
What does $@ mean bash?
Is shell scripting difficult?
What is an inode block?
What is subshell?
i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..
What language is used in terminal?
Is shell a scripting language?