Skip to content

Instantly share code, notes, and snippets.

@sagax
Created January 20, 2019 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sagax/4e2bf0c9b4611a456b0040fa354ef2d5 to your computer and use it in GitHub Desktop.
Save sagax/4e2bf0c9b4611a456b0040fa354ef2d5 to your computer and use it in GitHub Desktop.
generator of file as json with array of words
# one command line
export LINE=200000 LWORD=31 FNAME="dict.json" && printf "[" > "$FNAME" && cat /dev/random | tr -dc 'a-zA-Z' | fold -w $LWORD | head -n $LINE | sed 's/^/"/; s/$/",/' >> "$FNAME" && sed -i '$s/",/"]/' "$FNAME"
#
export \
LINE=200000 \
LWORD=31 \
FNAME="dict.json" && \
printf "[" > "$FNAME" && \
cat /dev/random | tr -dc 'a-zA-Z' | fold -w $LWORD | head -n $LINE | sed 's/^/"/; s/$/",/' >> "$FNAME" && \
sed -i '$s/",/"]/' "$FNAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment