Created
January 25, 2016 18:56
-
-
Save sirkkalap/93c9a644eb660d4edea8 to your computer and use it in GitHub Desktop.
BASEDIR allows running scripts without cd'ing into their folders first. With properly set basedir all local resources can be referenced without CWD being in the script folder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASEDIR=$(cd "$(dirname "$0")"; pwd) | |
echo $BASEDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment