Skip to content

Instantly share code, notes, and snippets.

@sean9999
Created November 29, 2018 14:47
Show Gist options
  • Save sean9999/b4e92a320912d14d78fa4166ca58c6b5 to your computer and use it in GitHub Desktop.
Save sean9999/b4e92a320912d14d78fa4166ca58c6b5 to your computer and use it in GitHub Desktop.
bash:: get path of current file
#!/bin/bash
## @from: https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment