Don't use ksh either. In some versions, the exit status of a pipeline is the exit status of the last component to terminate, not that of the last component of the pipe line (set +o monitor seems to restore the sh, last component of the pipe line behavior, but that isn't documented).