chbs/chbs.sh
2021-02-20 11:05:32 +01:00

20 lines
349 B
Bash
Executable file

#!/bin/sh
# WTFPL !
datadir="./data"
separator='-'
words=4
for arg in "$@"
do
case $arg in
-s=*|--separator=*)
separator="${arg#*=}"
shift
;;
esac
done
correcthorse=$(cat $datadir/* | sed 's/,/\n/g' | shuf | tail -n $words | sed "s/$/$separator/; s/\b\(.\)/\u\1/" | tr -d \[:space:\])
echo $correcthorse$(shuf -i0-9 -n1)