Last active
November 17, 2016 19:59
-
-
Save eug/ae0bfa2e5008302b7992 to your computer and use it in GitHub Desktop.
Simple log functions for shell scripts
This file contains 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
# Functions | |
__err() { echo -e "\033[31mError:\033[0m $1"; exit; } | |
__warn(){ echo -e "\033[33mWarn :\033[0m $1"; } | |
__info(){ echo -e "\033[34mInfo :\033[0m $1"; } | |
# Use | |
__err "You must be root." | |
__warn "Missing temp file" | |
__info "Copying 'x' file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment