Skip to content

Instantly share code, notes, and snippets.

@diewland
Last active August 12, 2022 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diewland/76cb1bb23d1c02eb8aac33fb85cec829 to your computer and use it in GitHub Desktop.
Save diewland/76cb1bb23d1c02eb8aac33fb85cec829 to your computer and use it in GitHub Desktop.
shuffle list to find the winner
# shuffle to tmp file
shuf $1 -o $1.tmp
# shuffle 16 times
for (( i=1; i<=16; i++ )); do
shuf $1.tmp -o $1.tmp
done
# last shuffle and show winner
shuf $1.tmp -n 1
# remove tmp file
rm $1.tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment