Created
October 18, 2021 13:59
-
-
Save uilian/96d76610ad2d7cf54c15113d51c87be5 to your computer and use it in GitHub Desktop.
Custom cowsay script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# see: http://blog.tomtung.com/2009/11/cowsay-fortune | |
# http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed | |
# https://github.com/busyloop/lolcat | |
# https://github.com/dorentus/mruby-lolcat-bin | |
# | |
# requires `fortune`, `cowsay`, | |
# and ruby gem `lolcat` or its mruby version equivalent | |
# Randomly pick a mode of the cow | |
MODES=("" -b -d -g -p -s -t -w -y ); | |
MODE=${MODES[$(($RANDOM % 9))]} | |
# Radomly pick a cow picture file | |
COWIMG=`cowsay -l | sed '1d;s/ /\n/g'| sort -R | head -1` | |
fortune | cowsay -f $COWIMG $MOD | lolcat | |
printf "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment