if [ $UNITS = day ]; then
while ((OFFSET > 0)); do
if (( OFFSET >= day )) ;then
month=$((month - 1))
if (( month == 0 )) ;then
year=$((year - 1))
month=12
fi
set -A days `cal $month $year`
OFFSET=$((OFFSET - day))
day=${days[$(( ${#days[*]}-1 ))]}
else
day=$((day - OFFSET))
OFFSET=0
fi
done
The above code patch is running fine in AIX but when I am trying to run the same in Linux I am getting the below error:
set: -A: invalid option
set: usage: set [--abefhkmnptuvxBCHP] [-o option-name] [arg ...]
set -A
is even deprecated inksh
nowadays. looks likebash
based on theBHCP
stuff. dodays=($(cal $month $year))
– mikeserv Nov 11 '15 at 08:39set -A
is deprecated. – cuonglm Nov 11 '15 at 08:47set
was deprecated syntax because korn intends typeset to handle all of that. – mikeserv Nov 11 '15 at 09:03