Created
November 8, 2016 18:37
-
-
Save lcaballero/3778e9682b9b639717ee34b7c8dedb25 to your computer and use it in GitHub Desktop.
Simplistic way to add color to shell scripts in console output.
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
#!/usr/bin/env bash | |
red=31 ; green=32 ; brown=33 ; blue=34 | |
purple=35 ; cyan=36 ; light_gray=37 | |
function _a() { | |
echo -e -n "\033[$1m${@:2}\033[0m " | |
} | |
function _rd() { | |
_a $red $* | |
} | |
function _gr() { | |
_a $green $* | |
} | |
function _br() { | |
_a $brown $* | |
} | |
function _bl() { | |
_a $blue $* | |
} | |
function _pr() { | |
_a $purple $* | |
} | |
function _cy() { | |
_a $cyan $* | |
} | |
function _gy() { | |
_a $light_gray $* | |
} | |
function _n() { | |
echo -e "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment