4 ms·
You want unpredictable random numbers, so using bash $RANDOM is no good. hexdump + /dev/urandom + sed would work, incantation left as an exercise to reader as I
by zurn 12y ago
You want unpredictable random numbers, so using bash $RANDOM is no good. hexdump + /dev/urandom + sed would work, incantation left as an exercise to reader as I don't have a Mac around to check limitations of their hexdump(1)...
(Same goes for the Python solution posted in another comment here).
- elasticdog 12y agoHere's the way to properly grab a random line from a file using Bash: http://mywiki.wooledge.org/BashFAQ/026 http://mywiki.wooledge.org/BashFAQ/026