Skip to content

Instantly share code, notes, and snippets.

@rothwerx
Created October 21, 2015 16:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rothwerx/7aa31f5437a4fc2b9416 to your computer and use it in GitHub Desktop.
Bash: Logging helper function
function pecho {
if [[ $LOGGING ]]; then
printf "$@" | tee -a some.log
else
printf "$@"
fi
}
pecho "%-10s %10s\n" "Logging:" "On"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment