Skip to main content

Get the absolute directory path to the currently executing bash script.

#!/usr/bin/env bash

# To store the path of the executing script's directory in var `__DIR__`:
__DIR__="$(cd "$(dirname "${0}")"; echo "$(pwd)")"