aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-12-19 13:58:24 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-12-19 13:58:24 -0800
commit4e6f52c13d9858800e4cf3aa029f48b30712d66d (patch)
tree6d5382e76a82810c65755e96e88c8f85f8d2c76a
parentac7f3c3f8f53773b42d33b901f73c615c60479ad (diff)
downloadcdlog-4e6f52c13d9858800e4cf3aa029f48b30712d66d.tar.gz
cdlog-4e6f52c13d9858800e4cf3aa029f48b30712d66d.tar.bz2
cdlog-4e6f52c13d9858800e4cf3aa029f48b30712d66d.zip
Bail if not interactive.
* cdlog.sh (mainline): If Bash is not interactive, then we exit from the script.
-rw-r--r--cdlog.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/cdlog.sh b/cdlog.sh
index d8aa931..f0bb25f 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -1,5 +1,8 @@
# License at bottom.
+# Bail if not interactive
+[[ $- == *i* ]] || return 0
+
# Globals
declare -a cdlog_hist # directory history
declare -A cdlog_alias # cd aliases