a few comments:
1. this Code:
set -A instance
instance[1]="ont0"
instance[2]="qbc1"
instance[3]="jdbc0"
instance[4]="admin1"
can be made with that:
Code:
set -A instance 'ont0' 'qbc1' 'jdbc0' 'admin1'
the same goes for the OTHER array declaration/initialization.
btw, arrays are ZERO-based - not ONE-based
2.
Code:
function setYear{
if [ ${DATEmonth} == 1 ]
then
DATEyear=${DATEyear}-1
fi
}
DATEyear is declared as integer and should be compared as such.
Code:
if (( DATEmonth == 1 ))
and substraction should be performed as such:
Code:
(( DATEyear = DATEyear -1 ))
3. for your actual error.... - you need either a SPACE between the function name the trailing '{' OR you need to put '{' on a new line:
Code:
function setYear {
OR
function setYear
{
there are other potential problems with the script, but we'll go slow - fix the ones above first and start debugging the output next.
good luck.
|