2014-01-21 21:30:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Log all environment variables to ZED_DEBUG_LOG.
|
|
|
|
#
|
2015-02-18 01:23:54 +00:00
|
|
|
# This can be a useful aid when developing/debugging ZEDLETs since it shows the
|
|
|
|
# environment variables defined for each zevent.
|
2014-01-21 21:30:03 +00:00
|
|
|
|
2015-02-18 01:23:54 +00:00
|
|
|
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
|
|
|
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
|
|
|
|
|
|
|
: "${ZED_DEBUG_LOG:="${TMPDIR:="/tmp"}/zed.debug.log"}"
|
2014-01-21 21:30:03 +00:00
|
|
|
|
2015-02-18 01:23:54 +00:00
|
|
|
lockfile="$(basename -- "${ZED_DEBUG_LOG}").lock"
|
|
|
|
|
|
|
|
umask 077
|
|
|
|
zed_lock "${lockfile}"
|
|
|
|
exec >> "${ZED_DEBUG_LOG}"
|
2014-01-21 21:30:03 +00:00
|
|
|
|
|
|
|
printenv | sort
|
|
|
|
echo
|
|
|
|
|
2015-02-18 01:23:54 +00:00
|
|
|
exec >&-
|
|
|
|
zed_unlock "${lockfile}"
|
2014-01-21 21:30:03 +00:00
|
|
|
exit 0
|