Skip to content

Instantly share code, notes, and snippets.

@stchris
Created December 7, 2022 19:55
Show Gist options
  • Save stchris/a78933de8cb83f4325d87297086f55ff to your computer and use it in GitHub Desktop.
Save stchris/a78933de8cb83f4325d87297086f55ff to your computer and use it in GitHub Desktop.
Generate a large amount of LibreOffice ODT files with random content
#!/usr/bin/env bash
# number of .odt files to generate
HOW_MANY=100
# number of random words to insert
WORD_COUNT=5000
# file prefix
PREFIX="rand-"
for (( i=1; i<=$HOW_MANY; i++ )) do
shuf -n $WORD_COUNT /usr/share/dict/words > rand.txt
timestamp=$(gdate +%s.%N)
pandoc -o $PREFIX$timestamp.odt rand.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment