Skip to content

Instantly share code, notes, and snippets.

@mhammonds
Created May 17, 2014 19:44
Show Gist options
  • Select an option

  • Save mhammonds/f76f8d3e988861a39adf to your computer and use it in GitHub Desktop.

Select an option

Save mhammonds/f76f8d3e988861a39adf to your computer and use it in GitHub Desktop.
Demo: Color Output From Bash Script on Linux
#!/bin/bash
# This script is a simple demo showing
# how to color output from a bash script.
green='\e[0;32m'
red='\e[0;31m'
NC='\e[0m' #No Color
echo -e "
${green}This is green text.
${red}This is red text.
${NC}This is normal/non-colored text.
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment