1 2 3 4 5 6 7 8 9
function in_array() { local hay needle=$1 shift for hay; do [[ $hay == $needle ]] && return 0 done return 1 }