diff --git a/utils.sh b/utils.sh index c61bce7c5f637d62fb484e124a87edcd7977e424..0f2162bc7f3dbc9b0aa2dbec55eb528c1c1becab 100755 --- a/utils.sh +++ b/utils.sh @@ -6,7 +6,7 @@ # and checking current user value, and prompts of yes/no user input. # # https://git.brandon-rodriguez.com/scripts/bash/utils - # Version 1.1. + # Version 1.2 ## @@ -204,11 +204,11 @@ function get_absolute_path () { # Handle for directory. # Extra logic to properly handle values of "./" and "../". - local current_dir="$(pwd)" + local current_dir="$(pwd -P)" cd ${1} # Then call this to have consistent symlink handling as files. - return_value="$(cd "$(dirname "$(pwd)")"; pwd -P)/$(basename "$(pwd)")" + return_value="$(cd "$(dirname "$(pwd -P)")"; pwd -P)/$(basename "$(pwd -P)")" # Change back to original location once value is set. cd ${current_dir}