write a shell script to identify the given string is
palindrome or not?
Answer Posted / lekhrajdeshmukh
n=$1
a=0
b=0
while [ $n -gt 0 ]
do
b=$(( $n % 10 ))
a=$(( ($a * 10) + $b ))
n=$(( $n /10 ))
done
if [ $a -eq $1 ]
then
echo "$1 number is palindrome number"
else
echo "$1 is not an palindrome number"
fi
| Is This Answer Correct ? | 56 Yes | 53 No |
Post New Answer View All Answers
Is powershell a language?
How to print all the arguments provided to the script?
How do I run a bin bash script?
What does chmod do?
How to get the last line from a file using just the terminal?
What is bash eval?
What does egrep mean?
What is the command to find out today's date?
what is tickets $ what low,medium,high priorite pls define time also
Why is the use of shell script?
Write the syntax for "if" conditionals in linux?
How can I set the default rwx permission to all users on every file which is created in the current shell?
What is the use of .sh file?
When should shell programming/scripting not be used?
What is inside a seashell?