Skip to content

Instantly share code, notes, and snippets.

@eug
Last active November 17, 2016 19:59
Show Gist options
  • Save eug/ae0bfa2e5008302b7992 to your computer and use it in GitHub Desktop.
Save eug/ae0bfa2e5008302b7992 to your computer and use it in GitHub Desktop.
Simple log functions for shell scripts
# 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