#/bin/sh check_bin_in_path() { for bin in $1; do if [ -z $(which ${bin} 2>/dev/null) ]; then MISSING="${MISSING} ${bin}" fi done } check_bin_in_path "eix-sync emerge grep echo cat lsof awk sort" check_bin_in_path "restart-services sendmail rm" if [ ! -z "${MISSING}" ]; then printf "You’r missing this:${MISSING}\n" else printf "All looks good\n" fi