-# debug() {
-# local dbg=/dev/stderr
-# if [ "$#" -gt 0 ]; then
-# printf '%s\n' "$@" >>"$dbg"
-# else
-# tee -a "$dbg"
-# fi
-# }
-debug() { [ "$#" -gt 0 ] && : || cat; }
+debug() {
+ local dbg=/dev/stderr
+ if [ ! "$DEBUG" ]; then
+ [ "$#" -gt 0 ] && : || cat;
+ elif [ "$#" -gt 0 ]; then
+ printf '%s\n' "$@" >>"$dbg"
+ else
+ tee -a "$dbg"
+ fi
+}