#!/bin/bash num=$# ARGV=( "$@" ) if [ $num -lt 2 ]; then echo "need a list of names to choose from" exit 1 fi r=$(( ( RANDOM % $num ) )) echo -n "And the winner is number $r: " echo "${ARGV[$r]}"