From 93f9dbabf93de68c0426aaaf118a3604b881f690 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Wed, 7 Apr 2021 08:39:47 +0900 Subject: [PATCH] include/log: Use $0 to determine the script name BASH_ARGV0 is not supported on older bash versions. This commit changes the log module to use $0 to determine the script name instead. --- include/log.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/log.sh b/include/log.sh index 41d2c1c..dbac5ea 100644 --- a/include/log.sh +++ b/include/log.sh @@ -4,7 +4,9 @@ __init() { local script_name local timestamp - if ! script_name=$(basename "$BASH_ARGV0"); then + script_name="${0##*/}" + + if [[ -z "$script_name" ]]; then echo "Could not determine script name" 1>&2 return 1 fi -- 2.47.3