17 lines
204 B
Bash
Executable File
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]}"
|