Last active
November 13, 2016 17:10
-
-
Save gotofritz/d67cce160e8e2b61491a5830b6a446ff to your computer and use it in GitHub Desktop.
Bash scripting snippets
This file contains hidden or 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
# gives you the directory in which the running script is | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
This file contains hidden or 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
# on os x, without the -e it won't print a newline but \n | |
echo -e "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
current-script-directory.sh from http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in