Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 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"