diff --git a/README.md b/README.md index d27ff5b..264cbec 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ Inherited from the [BARE-MINIMUM](#bare-minimum) flavor, but with the following + `script_dir`: The absolute path of the directory that contains the shell script + `script_filename`: The full filename of the shell script + `script_name`: The name of the shellscript, excluding the filename suffixes + + `script_basecommand`: The base command(without arguments) when running the script + + `script_args`: An array containing all the command-line arguments when running the script ## [MODULAR](modular.sh) diff --git a/basic.sh b/basic.sh index a709707..ffd0cf4 100755 --- a/basic.sh +++ b/basic.sh @@ -67,6 +67,12 @@ if test -v BASH_SOURCE; then script_name="${script_filename%%.*}" } fi +# Convenience variables may not need to be referenced +# shellcheck disable=SC2034 +{ + script_basecommand="${0}" + script_args=("${@}") +} printf \ 'Info: Operation completed without errors.\n' diff --git a/modular.sh b/modular.sh index 3a8278d..7842493 100755 --- a/modular.sh +++ b/modular.sh @@ -72,6 +72,12 @@ if test -v BASH_SOURCE; then script_name="${script_filename%%.*}" } fi +# Convenience variables may not need to be referenced +# shellcheck disable=SC2034 +{ + script_basecommand="${0}" + script_args=("${@}") +} trap_err(){ printf \