[SunHELP] KSH Mystery

Naser Ali Ali.Naser at irs.gov
Tue Jul 29 08:40:47 CDT 2003


Gurus,

This happened atleat three times before in the past and it is
intermittent.Almost impossible to re-create. In this script we do a
sequential grep for a specific string from a file and check for a condition,
this is how it looks like

============================================================================
===============
    232          echo
   233          echo "Load started at `date`"
   234          echo
   235
   236          i=0
   237          DFLG="DIRECT=false"
   238          while [ $i -lt ${#TBL_NAMES[*]} ]
   239          do
   240                  table=${TBL_NAMES[$i]}
   241
   242                  # Get the number of records for the above table
   243                  NUM_REC=$(grep -i "$table\."
$DATA_DIR/LOGS/$TAPENUMBER.$JULIANDAY.recs | cut -d' ' -f2)
   244
   245                  if [ $NUM_REC -gt 0 ]; then
   246                          SKIP=0
   247                          if [ ${TBL_LD_FLGS[$i]} -eq 1 ]; then
   248                                  while [ $SKIP -lt $NUM_REC ]
   249                                  do
   250                                          sql_load $ORACLE_ID
$LOADER_CTRL_DIR $table $DATA_DIR \
   251                                                  $TAPENUMBER
$JULIANDAY $DFLG $SKIP $21_SQLLOAD_SIZE &
   252
SKIP=$((SKIP+$21_SQLLOAD_SIZE))
   253                                  done
   254                          else
   255                                  sql_load $ORACLE_ID $LOADER_CTRL_DIR
$table $DATA_DIR \
   256                                          $TAPENUMBER $JULIANDAY $DFLG
$SKIP &
   257                          fi
   258                  fi
   259
   260                  i=$((i+1))
   261          done
   262
============================================================================
===============

the error we recieve is 
---------------------------------------------------
/operator/bin/call_21[245]: test: argument expected
ALL SQL*Loader processes completed successfully.
---------------------------------------------------

we do not understand why this happens even though all the string we are
grepping for are there.
Has anyone seen anything like it before. Is the ksh buggy. This is Solaris
2.8 env.

Any pointer pointers or hints will be appreciated.

TIA 



More information about the SunHELP mailing list