ksh93 on AIX not treating leading-zero constants as octal when OCTAL_CONST=ON #899
-
| 
         I’m running into an issue with numeric constants in ksh93 on AIX $ ksh93 --version export OCTAL_CONST=ON val1=$((015)) val2=$((045)) Expected behavior: Actual behavior: val2=$((045)) Question:  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
| 
         May be you meant  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Apologies for the confusion in my earlier message — the macro I mentioned (OCTAL_CONST) is redundant. val1=$((015)); echo $val1 `$ ksh93 --version $ val1=$((015)); echo $val1 $ val1=$((015)); echo $val1 It looks like one version is treating 015 as octal, while the other interprets it as decimal.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         May be posix mode was on on some of yours systems  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         On ksh93 (93u+ 2012-08-01), it seems that POSIX mode is enabled by default, but it does not appear in the set -o output. Is this the expected behavior, or should posix be listed in the set -o output?  | 
  
Beta Was this translation helpful? Give feedback.
The
posixoption is a u+m addition to ksh93, it is not in the AT&T release.From NEWS: