oliverdavies.uk/scripts/common.sh
2019-03-01 10:14:57 +00:00

9 lines
152 B
Bash

#!/usr/bin/env bash
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
SCRIPTPATH=$(realpath "$0")
SCRIPTDIR=$(dirname $SCRIPTPATH)