Created
September 22, 2015 09:22
-
-
Save rickowski/980d934f423e008ee798 to your computer and use it in GitHub Desktop.
Print red and green messages in bash. Example.
This file contains hidden or 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
#!/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