Bash

From Leaky
Revision as of 13:23, 1 August 2013 by Leaky (talk | contribs) (Created page with ' == Find the location of a script, no matter how it's referenced when run == DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo $DIR')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Find the location of a script, no matter how it's referenced when run

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 
echo $DIR