Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active August 29, 2015 13:58
Show Gist options
  • Save miguelmota/10012499 to your computer and use it in GitHub Desktop.
Save miguelmota/10012499 to your computer and use it in GitHub Desktop.
Current directory of script in bash.
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
echo $DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment