Merge branch 'release-2.140.93'
[feisty_meow.git] / examples / bashisms / script_location.sh
index bdae0fc7735ac04acc2114716d88a1ed5bdc4451..7fa942a6302f90daba31cd31c49a686c3ef4def4 100644 (file)
@@ -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.