Files
bin/names_out_of_a_hat.sh

17 lines
204 B
Bash
Executable File

#!/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]}"