Closed webpro closed 10 years ago
Yes. It cd's into the dirname of the current script (${BASH_SOURCE[0]}) and then takes the pwd of that, which becomes DIR. This takes symlinks into account and is pretty safe to use.
cd
dirname
${BASH_SOURCE[0]}
pwd
DIR
Oh well, you just merged, thanks!
Yah. Looks convoluted, but is the commonly accepted way to do it, I guess. :) Thanks!
Yes. It
cd
's into thedirname
of the current script (${BASH_SOURCE[0]}
) and then takes thepwd
of that, which becomesDIR
. This takes symlinks into account and is pretty safe to use.