to be or not to be

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
function vote() {
test "$#" -le "2" && {
echo "You should set subject and at least two option for polling";
return 1;
}
# Todays subject
echo "$1";
# Collect data
while shift
do
local VOTES;
test -z "$1" && break;
for i in $(seq 1 $(( 1 + $RANDOM % 10 )) );
do
let VOTES=VOTES+$(( $RANDOM % 10 ));
done;
printf "%-15s\t%s\n" "$1" "$VOTES";
unset VOTES;
done;
}