Use "command -v" instead of "which" for better POSIX compliance
Skip blank lines when expecting echoed return code