Old high school files. Lessson notes/codes/projects etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hsf/rep2/hangman/get_words.sh

13 lines
240 B

#!/usr/bin/bash
if [ -z $1 ]; then
echo "Usage: get_words.sh (output file)"
exit
fi
api_url=https://random-word-api.herokuapp.com/all
words=$(curl -s $api_url | sed 's/\",\"/\ /g' | sed 's/\"\]//g' | sed 's/\[\"//g')
echo $words > $1