checking for ism_op errors in a script
Posted in 2003
zzz — — source: Usenet: comp.databases.informix
I'm testing a new script for a guy who will change log tapes, but apparently ism_op returns a zero exit code, even when there's an error. So far, the error is intentional - I haven't added him to the ism administrators, and I've overcome this by checking for the literal "error" in the last line of ism_op output....like so ism_op -unmount $LOGDEV 2>&1 | tee $LOG_FILE RSLT=$? tail -1 $LOG_FILE | grep -q error ERROR=$? if [ $RSLT -ne 0 -o $ERROR -ne 1 ] then # do my error handling here. fi Does ism_op EVER return a non-zero exit code? When it doesn't, will looking at the last line of output as demonstrated above be sufficient? Anyone got any better ideas? Thanks in advance,