Check for bash before mksh

This commit is contained in:
Daniel Perez 2019-03-31 20:44:49 +01:00
parent f2674374b0
commit 6523971b40

View File

@ -5,10 +5,10 @@
# For Bash, ${BASH_SOURCE[0]} will be used to obtain this script's path. # 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. # For Zsh and others, $0 (the path to the shell or script) will be used.
_under="$_" _under="$_"
if [[ "$_under" == *".sh" ]]; then if [ "${BASH_SOURCE[0]}" != "" ]; then
current_script_path="$_under"
elif [ "${BASH_SOURCE[0]}" != "" ]; then
current_script_path="${BASH_SOURCE[0]}" current_script_path="${BASH_SOURCE[0]}"
elif [[ "$_under" == *".sh" ]]; then
current_script_path="$_under"
else else
current_script_path="$0" current_script_path="$0"
fi fi