Created
May 8, 2015 10:33
-
-
Save xoner/bdbcc4df74c95e5e62df to your computer and use it in GitHub Desktop.
Random animals showing random quotes at your terminal
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 | |
# before running | |
# apt-get install cowsay fortune | |
COW_FILES_DIR="/usr/share/cowsay/cows/" | |
COW_FILE_ORDER=$(( (RANDOM %51) + 2)) | |
RDM_COW_FILE=$(ls -l $COW_FILES_DIR | tail -n +$COW_FILE_ORDER | head -n 1 | awk '{print $9}') | |
RDM_COW_PATH="$COW_FILES_DIR$RDM_COW_FILE" | |
fortune | cowsay -f $RDM_COW_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment