rwxrob-dot/scripts/sing
Rob Muhlestein 2ea0289e9f Rebase
2022-02-09 02:29:05 -05:00

25 lines
315 B
Bash
Executable File

#!/usr/bin/env bash
declare notes=(🎶 🎵 🎤)
randnote() {
local i=$((RANDOM % ${#notes[@]}))
echo ${notes[$i]}
}
sing() {
local what="$(randnote) $* $(randnote)"
echo "$what"
wee "/me sings: $what"
}
if test -n "$*"; then
sing "$*"
exit 0
fi
IFS=
while read -r line; do
sing "$line"
done