Monday, February 17, 2014

My Favorite Bash Line

My favorite bash line?

SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)

This little line gives you the abs path of the file the line resides in, regardless of whether a relative or absolute path was used to call the script.

No comments:

Post a Comment