Skip to content

Instantly share code, notes, and snippets.

@jeffery812
Last active October 27, 2019 09:56
Show Gist options
  • Save jeffery812/b02245d42c72c1cda2455644e494018a to your computer and use it in GitHub Desktop.
Save jeffery812/b02245d42c72c1cda2455644e494018a to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o nounset
set -o errexit
set -o verbose
set -o xtrace
log() {
local prefix="[$(date +%Y/%m/%d\ %H:%M:%S)]:"
echo "${prefix} $@" >&2
}
log "test"
# syntax check
# bash -n log.sh
#
# debug
# bash -x log.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment