Skip to content

Instantly share code, notes, and snippets.

@AndersDJohnson
Last active June 5, 2019 13:33
Show Gist options
  • Save AndersDJohnson/4243371 to your computer and use it in GitHub Desktop.
Save AndersDJohnson/4243371 to your computer and use it in GitHub Desktop.
bash script BASEDIR
#!/bin/bash
CURDIR=${PWD}
BASEDIR="$( cd "$( dirname "$(realpath $BASH_SOURCE)" )" && pwd )"
# This didn't support symlinked scripts
# BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment