AIX 5.2 vs 4.3.3 differences

From: Tony Gallo (tony_gallo@THRUWAY.STATE.NY.US)
Date: Fri Jun 13 2003 - 11:19:02 EDT


We recently upgraded a 7025 6F0 box from 4.3.3 to 5.2. So far the only
problem that the programmers reported was when they run the following to
manipulate the date:
4.3.3 software:
date=030611 (yymmdd)
date=$(($date+20000000))
echo $date
20030611 (this is
the result we want in yyyymmdd format)

5.2 software:
date=030611
date=$(($date+20000000))
echo $date
20012681

They believe that the leading 0 is causing the number to be treated as
an octal number. It is converting it to octal an then doing the
addition causing the difference. I realize to get the date they should
have used standard date functions but since they did this already, can
anyone tell me an easy way around this so they don't have to start
changing all their code??

TIA



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:55 EDT