[ Level 3 ] Bash script for color ansi.
#!/bin/bash ## Get ansi color code ## Usage: ## getAnsiColorCode (f)orward_ground/(b)ack_ground color_name ## ex. ## getAnsiColorCode f/b black/red/green/yellow/blue/magenta/cyan(purple)/white/default getAnsiColorCode() { sReturnCode="" fb='f' color='default' if [ $# -eq 1 ] then color="$1" elif [ $# -gt 1 ] then fb="$1" color="$2" fi if [ "$fb" == "b" ] then sReturnCode='4' else sReturnCode='3' fi case $color in black) sReturnCode="${sReturnCode}0" ;; red) sReturnCode="${sReturnCode}1" ;; green) sReturnCode="${sReturnCode}2" ;; yellow) sReturnCode="${sReturnCode}3" ;; blue) sReturnCode="${sReturnCode}4" ;; magenta) sReturnCode="${sReturnCode}5" ;; cyan|purple) sReturnCode="${sReturnCode}6" ;; white) ...