Skip to content

Instantly share code, notes, and snippets.

@rickowski
Created September 22, 2015 09:22
Show Gist options
  • Save rickowski/980d934f423e008ee798 to your computer and use it in GitHub Desktop.
Save rickowski/980d934f423e008ee798 to your computer and use it in GitHub Desktop.
Print red and green messages in bash. Example.
#!/bin/bash
function prnt_green(){
echo -e "\e[1;32m$1\e[0m"
}
function prnt_red(){
echo -e "\e[1;31m$1\e[0m"
}
echo "Normal text"
prnt_red "This is an error!"
prnt_green "This is a success!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment