typeset -i STARTTIME=`expr $STARTHOUR \* 60 \* 60 + $STARTMINUTE \* 60 + $STARTSECOND`
echo $STARTTIME
typeset -i ENDTIME=`expr $ENDHOUR \* 60 \* 60 + $ENDMINUTE \* 60 + $ENDSECOND`
echo $ENDTIME
typeset -i ELAPSED=`expr $ENDTIME - $STARTTIME`
typeset -i PREVIOUSTIME=`cat previouscompletion${wf}.txt`
if [$ELAPSED -ne $PREVIOUSTIME]; then
echo $ELAPSED > previouscompletion${wf}.txt
fi
Above is an if statement I'm trying to get to run within a bash script on an AIX 6.1 server.
What it's giving me when I attempt to run it though, is the correct numbers in the echoes, but once it hits the if statement it croaks and gives me
./wf_zabbix_test.sh: line 46: [8: command not found
I've gotten case blocks to work on AIX, but only when comparing string variables, but I can't get any of these comparisons to work with integers. Sadly the AIX manuals are sorely lacking in information, and everything I've been able to Google seems directed more towards use in other Linux distributions.
Any help, even just a link to a page with how to do a darn if statement in AIX, would be greatly appreciated.