Skip to content

Instantly share code, notes, and snippets.

@xzer
Created July 5, 2017 06:08
Show Gist options
  • Save xzer/f7200cb612dec2c83ced8a6570437d89 to your computer and use it in GitHub Desktop.
Save xzer/f7200cb612dec2c83ced8a6570437d89 to your computer and use it in GitHub Desktop.
a debug shell script to show colored text on console with dedicated color
#!/bin/bash
ANSI_RESET="\u001B[0m"
ANSI_BLACK="\u001B[30m"
ANSI_LBLACK="\u001B[1;30m"
ANSI_RED="\u001B[31m"
ANSI_LRED="\u001B[1;31m"
ANSI_GREEN="\u001B[32m"
ANSI_LGREEN="\u001B[1;32m"
ANSI_YELLOW="\u001B[33m"
ANSI_LYELLOW="\u001B[1;33m"
ANSI_BLUE="\u001B[34m"
ANSI_LBLUE="\u001B[1;34m"
ANSI_PURPLE="\u001B[35m"
ANSI_LPURPLE="\u001B[1;35m"
ANSI_CYAN="\u001B[36m"
ANSI_LCYAN="\u001B[1;36m"
ANSI_WHITE="\u001B[37m"
ANSI_LWHITE="\u001B[1;37m"
echo -e "$ANSI_BLACK black $ANSI_RESET"
echo -e "$ANSI_LBLACK light black $ANSI_RESET"
echo -e "$ANSI_RED red $ANSI_RESET"
echo -e "$ANSI_LRED light red $ANSI_RESET"
echo -e "$ANSI_GREEN green $ANSI_RESET"
echo -e "$ANSI_LGREEN light green $ANSI_RESET"
echo -e "$ANSI_YELLOW yello $ANSI_RESET"
echo -e "$ANSI_LYELLOW light yellow $ANSI_RESET"
echo -e "$ANSI_BLUE blue $ANSI_RESET"
echo -e "$ANSI_LBLUE light blue $ANSI_RESET"
echo -e "$ANSI_PURPLE purple $ANSI_RESET"
echo -e "$ANSI_LPURPLE light purple $ANSI_RESET"
echo -e "$ANSI_CYAN cyan $ANSI_RESET"
echo -e "$ANSI_LCYAN light cyan $ANSI_RESET"
echo -e "$ANSI_WHITE white $ANSI_RESET"
echo -e "$ANSI_LWHITE light white $ANSI_RESET"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment