diff --git a/asdf.sh b/asdf.sh index 48247d9a..ea8e490a 100644 --- a/asdf.sh +++ b/asdf.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# For Korn shells (ksh, mksh, etc.), capture $_ (the final parameter passed to +# the last command) straightaway, as it will contain the path to this script. +# For Bash, ${BASH_SOURCE[0]} will be used to obtain this script's path. +# For Zsh and others, $0 (the path to the shell or script) will be used. _under="$_" if [[ "$_under" == *".sh" ]]; then current_script_path="$_under"