assorted examples being moved to the top.
[feisty_meow.git] / examples / bashisms / script_location.sh
diff --git a/examples/bashisms/script_location.sh b/examples/bashisms/script_location.sh
new file mode 100644 (file)
index 0000000..bdae0fc
--- /dev/null
@@ -0,0 +1,7 @@
+
+# find out the location where this script is running from.  this will not
+# 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 )"
+