Hi
I am facing a strange problem
a=03
echo ${a}
the output is 3
But i want to display it is 03
Can you people help me how to display it like 03.
Thanks
Hi
I am facing a strange problem
a=03
echo ${a}
the output is 3
But i want to display it is 03
Can you people help me how to display it like 03.
Thanks
a='03'
or using Korn shell print it out in the correct format
a=3
printf '%02d\n' ${a}
What shell are you using? It must be broken to do that. My version of ksh does
#
# a=03
# echo ${a}
03
# ((a=03))
# echo ${a}
3
#
In the arithmetic assignment the leading 0 means the number is octal.
# ((a=010))
# ((a=a-1))
# echo ${a}
7
#
There is not too much you can do with a broken shell. Can you try a better shell?