aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-01-03 17:04:29 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-01-03 17:04:29 +0100
commit3ec67bef94c4feacde558faf2cc68abf44890a32 (patch)
tree717bfc4065be67a7a5e431e85b890f626018b802 /bin
parent5054a51addfec1b7c539210a5ce954e98a59a2c4 (diff)
fix slw randomness
Diffstat (limited to 'bin')
-rwxr-xr-xbin/slw22
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/slw b/bin/slw
index 5c93c26..03ed074 100755
--- a/bin/slw
+++ b/bin/slw
@@ -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