aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zed/zed.d/all-debug.sh
blob: ba19b96b082fe1330b5cf8c2fc4d0f3670376498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# shellcheck disable=SC2154
#
# Log all environment variables to ZED_DEBUG_LOG.
#
# This can be a useful aid when developing/debugging ZEDLETs since it shows the
# environment variables defined for each zevent.

[ -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"}"

zed_exit_if_ignoring_this_event

zed_lock "${ZED_DEBUG_LOG}"
{
	printenv | sort
	echo
} 1>&"${ZED_FLOCK_FD}"
zed_unlock "${ZED_DEBUG_LOG}"

exit 0