Created
March 29, 2019 01:07
-
-
Save peter-avila/a35beb845ecaca5f17857d033aa551ab to your computer and use it in GitHub Desktop.
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
# | |
# ~/.bashrc | |
# | |
[[ $- != *i* ]] && return | |
colors() { | |
local fgc bgc vals seq0 | |
printf "Color escapes are %s\n" '\e[${value};...;${value}m' | |
printf "Values 30..37 are \e[33mforeground colors\e[m\n" | |
printf "Values 40..47 are \e[43mbackground colors\e[m\n" | |
printf "Value 1 gives a \e[1mbold-faced look\e[m\n\n" | |
# foreground colors | |
for fgc in {30..37}; do | |
# background colors | |
for bgc in {40..47}; do | |
fgc=${fgc#37} # white | |
bgc=${bgc#40} # black | |
vals="${fgc:+$fgc;}${bgc}" | |
vals=${vals%%;} | |
seq0="${vals:+\e[${vals}m}" | |
printf " %-9s" "${seq0:-(default)}" | |
printf " ${seq0}TEXT\e[m" | |
printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m" | |
done | |
echo; echo | |
done | |
} | |
[[ -f ~/.extend.bashrc ]] && . ~/.extend.bashrc | |
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment