initial commit of bin scripts into git
This commit is contained in:
16
names_out_of_a_hat.sh
Executable file
16
names_out_of_a_hat.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/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]}"
|
||||
Reference in New Issue
Block a user