Bash get self directory trick

This bash trick is great have been using it for years wanted to share.
SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)

Comments

Steve said…
Great little unix nugget! must add this to my bag of tricks ;)
gemmell said…
Thats friggen awesome. Thanks for that.

Popular posts from this blog

Vim vi how to reload a file your editing