diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-01-03 17:04:29 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-01-03 17:04:29 +0100 |
commit | 3ec67bef94c4feacde558faf2cc68abf44890a32 (patch) | |
tree | 717bfc4065be67a7a5e431e85b890f626018b802 /bin | |
parent | 5054a51addfec1b7c539210a5ce954e98a59a2c4 (diff) |
fix slw randomness
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/slw | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -1,24 +1,30 @@ #! /bin/bash +rand() { + tr -dc 0-9 < /dev/urandom | head -c 5 | sed 's/^0*//' + echo +} + reset while [ true ]; do - CARS=$(( ${RANDOM} % 16 + 1 )) + CARS=$(( $(rand) % 16 + 1 )) + FLAGS="" - if [ $(( ${RANDOM} % 2 )) -eq 0 ]; then + if [ $(( $(rand) % 2 )) -gt 0 ]; then FLAGS="${FLAGS}-a " fi - if [ $(( ${RANDOM} % 2 )) -eq 0 ]; then - FLAGS="${FLAGS}-c" + if [ $(( $(rand) % 2 )) -gt 0 ]; then + FLAGS="${FLAGS}-c " fi - if [ $(( ${RANDOM} % 2 )) -eq 0 ]; then - FLAGS="${FLAGS}-l" + if [ $(( $(rand) % 2 )) -gt 0 ]; then + FLAGS="${FLAGS}-l " fi - if [ $(( ${RANDOM} % 2 )) -eq 0 ]; then - FLAGS="${FLAGS}-w" + if [ $(( $(rand) % 2 )) -gt 0 ]; then + FLAGS="${FLAGS}-w " fi sl -${CARS} ${FLAGS} | lolcat |