Last active
March 21, 2022 13:27
-
-
Save josepsmartinez/522f627d88bd71c2c6089ca9de9260b7 to your computer and use it in GitHub Desktop.
Safe practice for attributing a script's directory UNIX path to a shell variable [Reference: https://stackoverflow.com/posts/4774063/revisions (2020/12/27)]
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
#!/bin/bash | |
SCRIPTPATH=$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment