Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
list=(these are some words)
printf '%s\n' "${list[RANDOM%${#list[@]}]}"

View file

@ -0,0 +1,2 @@
list=(these are some words)
printf '%s\n' "$list[RANDOM%$#list+1]"

View file

@ -0,0 +1,12 @@
# borrowed from github.com/search?q=bashnative
rand() {
printf $(( $1 * RANDOM / 32767 ))
}
rand_element () {
local -a th=("$@")
unset th[0]
printf $'%s\n' "${th[$(($(rand "${#th[*]}")+1))]}"
}
echo "You feel like a $(rand_element pig donkey unicorn eagle) today"