I have a ksh93 script that I'm migrating from AIX 6.1 to AIX 7.1
It's failing on 7.1 but works fine on 6.1. Here's a snippet of the important parts.
integer f_count=0
. . .
. . .
. . .
if [[ ($f_count*$sleep_interval%$alarm_interval -eq 0 ) && $f_count > 0 ]]
then
When it hits the "if" I get
line 191: *10%300: arithmetic syntax error
I decided to simplify it by typing this at the command prompt.
AIX 7.1> integer x=1
AIX 7.1> [[ $x*10%300 -eq 0 ]]
AIX 7.1> print $?
1
AIX 7.1> integer x=0
AIX 7.1> [[ $x*10%300 -eq 0 ]]
-ksh93: *10%300: arithmetic syntax error
AIX 6.1> integer x=1
AIX 6.1> [[ $x*10%300 -eq 0 ]]
AIX 6.1> print $?
1
AIX 6.1> integer x=0
AIX 6.1> [[ $x*10%300 -eq 0 ]]
AIX 6.1> print $?
0
To show it's ksh93 on AIX 6.1 I did this.
asdlkfjasd
-ksh93: asdlkfjasd: not found.
If I move the 0 value so it's not first, it works as expected.
AIX 7.1> integer x=1
AIX 7.1> [[ 10*$x%300 -eq 0 ]]
AIX 7.1> print $?
1
AIX 7.1> integer x=0
AIX 7.1> [[ 10*$x%300 -eq 0 ]]
AIX 7.1> print $?
0
This will fix my issue as I know the 2nd and 3rd variables in my original equation will never be 0.
Is this showing an AIX 7.1 bug?
${.sh.version}
on both systems?