Created
June 1, 2026 07:42
-
-
Save instantiator/b05f3c28c0e97b66bb9d63e7a5e4e4dd to your computer and use it in GitHub Desktop.
Obtain SCRIPT_PATH in shell scripts - useful for scripts that work on files in fixed relative directories
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
| # obtain the script path - taking into account any symlinks | |
| SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment