1

This question already has an answer here:

I have this logic in a ksh script on AIX 6.1 and it works fine.

integer loop_count=0
integer sleep_interval=5
integer alarm_interval=60
if (( $loop_count*$sleep_interval%$alarm_interval -eq 0 ))
then 
   echo "hello"
else
    echo "bye"
fi

On AIX 7.1 is gives me this error.

line 4: *5%60 -eq 0 : arithmetic syntax error

If I change it to

if (( $sleep_interval*$loop_count%$alarm_interval -eq 0 ))

so the variable that could be zero is not first, it works fine. Many other ways to fix it as well, but it's curious to me that the logic that was valid in 6.1 fails in 7.1.

marked as duplicate by Jeff Schaller, Scott, JdeBP, jimmij, RalfFriedl Dec 22 '18 at 17:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    What is the sh-bang (first) line of the script? – Jeff Schaller Dec 21 '18 at 19:32
  • Check the versions of ksh on 6.1 and 7.1. And better contact IBM support, seems like feature (or bug) – Romeo Ninov Dec 21 '18 at 20:23

Browse other questions tagged or ask your own question.