#!/bin/sh function has() { local command_name="${1}"; shift; set +o errexit hash "${command_name}" > /dev/null 2>&1; if [ 0 -eq ${?} ]; then set -o errexit return 0; fi set -o errexit return 1; }