Skip to content

Instantly share code, notes, and snippets.

@zhihuitang
Last active October 27, 2019 09:56
Show Gist options
  • Save zhihuitang/b02245d42c72c1cda2455644e494018a to your computer and use it in GitHub Desktop.
Save zhihuitang/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