exec 3>&1 m=`hash nosuchtool 2>&1 >&3` r=$? [ "$r" != 0 ] && [ -n "$m" ]