Created
August 12, 2025 07:09
-
-
Save kitzberger/704732fb2cf3b8b11d36b9de45dd4123 to your computer and use it in GitHub Desktop.
Current directory in bash
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
| #!/bin/bash | |
| # Current scripts folder (incl. resolving symlinks) | |
| SCRIPT_DIR="$( cd -P "$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" && pwd )" | |
| echo "This script lives in $SCRIPT_DIR and doesn't care from where you run it!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment