[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20000608: running McIDAS-X ADDE commands vi cron (cont.)



>From: Angel Li <address@hidden>
>Organization: RSMAS/University of Miami
>Keywords: 200006061956.e56JuLT23087 McIDAS-X ADDE cron mcbatch.sh mcrun.sh

Angel,

>Thanks for all that information, it has gotten me well underway.

Glad to have helped.

>Question: in a script, is there a way to tell if an IMGCOPY command
>failed?

Yes.  Pretty much all McIDAS commands return exit statuses that can
be checked.  Here is a snippit from a Korn shell script doing an IMGCOPY
that does just that:

   #SST - GOES-East Imager Regression SST
   SRCDATASET=CIMSSP/GERSST
   DESTDATASET=CIMSSLOCAL/CC
   KEYWORDS="SIZE=ALL"
   PROD=CC
   ANUM=12
   IBAND=1
   OBAND=31
   MEMO='CIMSS Prod.: Sea Sfc. Temp.'

   export SRCDATASET DESTDATASET KEYWORDS PROD ANUM IBAND OBAND MEMO

   imgcopy.k $SRCDATASET $DESTDATASET $KEYWORDS
   ret=$?
   if [[ $ret -eq 0 ]]; then
      imgcha.k $DESTDATASET.1 BAND=$OBAND MEMO="$MEMO"
      ret=$?
   else
      echo ERROR:  IMGCOPY of $SRCDATASET $DESTDATASET $KEYWORDS FAILED
      exit 1
   fi

>Do I have to parse the output of McIDAS session to find out?

Not any more.

>Thanks,

Later...

Tom