Hello, One thing I run into all the time with bash script is: I get a script that works perfectly when every thing is right, and is supposted to aleart me when something is wrong - often bashed on whether or not a particular var says something. But often the script fails because bash trips out over trying to test an empty var. For example: #!/bin/sh TAPESTATE=`mt -f /dev/st0 status | head -2 |tail -1 | cut -d " " -f4` if [ ${TAPESTATE} == "512" ]; then READY="yes" else READY="no" && echo "No tape in oe1 tape drive" | mail -s "Oe1 tape error" jw@mailsw.com fi if [ ${READY} == "yes" ]; then tar cplvf /dev/st0 -T /etc/mcmurray_backup.lst || echo "Tar failed during oe1 tape backup job" | mail -s "Oe1 backup job tar error" jw@mailsw.com else echo "Script failure in oe1 tar backup job" | mail -s "Oe1 backup job - error in script" jw@mailsw.com exit 1 fi As long as there's a tape in the tape drive it works out fine, but when there's not a tape, "mt -f /dev/st0 status" give the response: mt: /dev/st0: No medium found And apparently sends it to sterr so that $TAPESTATE remains empty (null). Now instead of just calmly passing on to the next section: else READY="no" && echo "No tape in oe1 tape drive" Bash give a response like this: usr/local/sbin/tape_bakup.sh: line 5: [: ==: unary operator expected And I've tried eq also. What's the proper way to do something like this? Thanks. -- ---------------------------------------------------- Jonathan Wilson Cedar Creek Software http://www.cedarcreeksoftware.com