Created
June 19, 2024 11:32
-
-
Save khurshid-alam/63b9f0a5fe93a2e68af096ede9711722 to your computer and use it in GitHub Desktop.
Get scripot name and path from inside bash script. see https://stackoverflow.com/a/246128/10200417
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 | |
# see https://stackoverflow.com/a/246128/10200417 | |
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
script_name=`basename $0` | |
# echo "called script $script_name from $script_dir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment