Skip to content

Instantly share code, notes, and snippets.

@jasemagee
Created May 30, 2015 09:42
Show Gist options
  • Save jasemagee/472347ed60968ea96ee2 to your computer and use it in GitHub Desktop.
Save jasemagee/472347ed60968ea96ee2 to your computer and use it in GitHub Desktop.
Fortune with random cowsay character and lolcat
fortune | cowsay -f "$(ls /usr/share/cowsay/cows | sort -R | head -1)" | lolcat
@leagris
Copy link

leagris commented Aug 17, 2024

Do not parse the output of ls!

See: https://mywiki.wooledge.org/ParsingLs

fortune | cowsay -f "$(printf %s\\n /usr/share/cowsay/cows/*.cow | shuf -n1)" | lolcat

or

fortune | cowsay -f "$(shuf -en1 /usr/share/cowsay/cows/*.cow)" | lolcat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment