# Wrong Integer value

**URL:** <https://community.unix.com/t/wrong-integer-value/296698>\
**Category:** Linux\
**Created:** [October 6, 2011, 8:10am UTC](https://community.unix.com/t/wrong-integer-value/296698 "2011-10-06T08:10:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prav\_chidugulla](https://community.unix.com/letter_avatar/prav_chidugulla/32/5_5575768a8748004e209b776fc1b2916d.png) [@prav\_chidugulla](https://community.unix.com/u/prav_chidugulla)\
**Post date:** [October 6, 2011, 8:10am UTC](https://community.unix.com/t/wrong-integer-value/296698/1 "2011-10-06T08:10:38Z")

</div>

I am migrating some shell script from Unix to Linux and i am getting wrong value for integer variable.

In Unix:  
integer X=007300  
echo $X  
7300

In Linux:  
integer X=007300  
echo $X  
3776

Please help me why it is giving wrong output.

---

<div class="post-metadata">

**Author:** ![Skrynesaver](https://community.unix.com/user_avatar/community.unix.com/skrynesaver/32/14143_2.png) [@Skrynesaver](https://community.unix.com/u/Skrynesaver)\
**Post date:** [October 6, 2011, 8:59am UTC](https://community.unix.com/t/wrong-integer-value/296698/2 "2011-10-06T08:59:06Z")

</div>

octal conversion taking place with the leading zeros.

```nohighlight
~/$ printf "%o\n" 3776
7300

```

EDIT: It's happening in my workstation which uses ksh93 (Ubuntu) but not the ksh on my server, RHEL-4.8 pdksh-5.2.14-30.6  
Perhaps installing pdksh if you are working under ksh93 would resolve  
Confirmed (invoking pdksh on my workstation resolves the issue):

```nohighlight
~/$ pdksh 
$ integer x=007300
$ echo $x
7300

```
