X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=examples%2Fbashisms%2Fscript_location.sh;h=7fa942a6302f90daba31cd31c49a686c3ef4def4;hb=1867a9e53c5e18a98cd49245cca7e66cb2aeb49a;hp=bdae0fc7735ac04acc2114716d88a1ed5bdc4451;hpb=a13cd5a85a0981acfd3702c4eaec9aeff3ed80da;p=feisty_meow.git diff --git a/examples/bashisms/script_location.sh b/examples/bashisms/script_location.sh index bdae0fc7..7fa942a6 100644 --- a/examples/bashisms/script_location.sh +++ b/examples/bashisms/script_location.sh @@ -3,5 +3,8 @@ # work properly in a bash script that is included via 'source' or '.'. # the first letter of each command is escaped to eliminate the danger of # personal aliases or functions disrupting the results. -ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && \pwd )" +ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )" + +# another slightly tighter version: +export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory.