#!/bin/bash if [ -z "$1" ] then echo "Please specify how many random words would you like to generate!" 1>&2 echo "example: $0 3" 1>&2 echo "This will generate 3 random words" 1>&2 exit 0 fi # Get the required number of words, convert it from a list of one word per line to one line with all # the words and then copy to clipboard. shuf -n "$1" /usr/share/dict/words | tr "\n" " "