Last active
November 22, 2017 18:23
-
-
Save Karthick333031/5ed29d179c3cf8e27fe836364fc01b2d to your computer and use it in GitHub Desktop.
Colorful bash promtps
This file contains hidden or 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 | |
############################################################################## | |
# Colorful Bash Prompts | |
# To be added to .bashrc | |
# Referred from https://schier.co/blog/2016/08/09/add-colorful-cows-to-your-terminal/ | |
# Modified the random file picker to bash | |
############################################################################## | |
randpos=$(awk -v min=1 -v max=$(cowsay -l | tail -n +2 | wc -w | tr -d ' ') 'BEGIN{srand(); print int(min+rand()*(max-min+1))}') | |
fortune | cowsay -f `echo $(cowsay -l | tail -n +2) | cut -f$randpos -d' '` | lolcat --seed 0 --spread 1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment