Created
April 15, 2016 10:51
-
-
Save flipsi/996a7509f6ab9c95eb79db3d727f1663 to your computer and use it in GitHub Desktop.
Shellscripting: cd to path of script itself
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
#!/usr/bin/env bash | |
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
echo $CURRENT_DIR | |
cd $CURRENT_DIR | |
touch foobarbaz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment