From 4e6f52c13d9858800e4cf3aa029f48b30712d66d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 19 Dec 2024 13:58:24 -0800 Subject: Bail if not interactive. * cdlog.sh (mainline): If Bash is not interactive, then we exit from the script. --- cdlog.sh | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3