function random_element { declare -a array=("$@") r=$((RANDOM % ${#array[@]})) printf "%s " "${array[$r]}" }