How to easily get multi-line passages from a text file in Bash?
July 23, 2021 10:48 PM Subscribe
One of my common Bash scripting patterns is like this:
shuf < playingcards.txt | head -n 3to "draw" 3 random playing cards from a text file with all the card names on separate lines. Is there a similarly simple way to pick three random multi-line passages from a text file? I am OK adding limited special formatting, like opening and closing a multi-line passage with lines of squigglies or something. Thanks!