diff --git a/eucarc b/eucarc index 2b0f7dd143..350235106c 100644 --- a/eucarc +++ b/eucarc @@ -13,7 +13,7 @@ if [[ -n "$2" ]]; then fi # Find the other rc files -RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) +RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd) # Get user configuration source $RC_DIR/openrc diff --git a/openrc b/openrc index 3de7e3958f..5344d247bd 100644 --- a/openrc +++ b/openrc @@ -18,7 +18,7 @@ if [[ -n "$2" ]]; then fi # Find the other rc files -RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) +RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd) # Import common functions source $RC_DIR/functions diff --git a/stackrc b/stackrc index 0151672c1d..4da481e98e 100644 --- a/stackrc +++ b/stackrc @@ -1,7 +1,7 @@ # stackrc # # Find the other rc files -RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) +RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd) # Destination path for installation DEST=/opt/stack