Created
October 16, 2019 05:59
-
-
Save jw-foss/7835440991f20ffe8512fe7111ce96af to your computer and use it in GitHub Desktop.
Get_Source_Directory.sh
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
| #!/usr/bin/bash | |
| # Senario | |
| # Direcotry: /Home/uname/work/some_proj/sub_folder | |
| # File in /Home/uname/work/some_proj | |
| # Command would be like | |
| # sh ../some_shell.sh | |
| # $pwd gets the current working diretory | |
| BASE_DIR="$(pwd)/$(dirname $BASH_SOURCE)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment