Last active
August 12, 2022 17:35
-
-
Save diewland/76cb1bb23d1c02eb8aac33fb85cec829 to your computer and use it in GitHub Desktop.
shuffle list to find the winner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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