On Thu, Mar 12, 2009 at 05:05:33PM -0400, Gerard wrote: > #!/usr/bin/env bash > > if $(which gpg2); then > printf "gpg2 located" > fi
The behavior of which(1) is not reliable across platforms. Since you're already using bash, you should consider using one of the bash builtins instead: if command -v gpg2 >/dev/null; then if hash gpg2 2>/dev/null; then if type -P gpg2 >/dev/null; then http://mywiki.wooledge.org/BashFAQ/081