Quantcast
Viewing all articles
Browse latest Browse all 130

How to Get Bash Script’s Own Path

Bash script may need to get its own path. In normal Bash script, $0 is the path to the script. However, when a script is sourced, such as . a.sh, a.sh‘s $0 does not give a.sh while the caller’s name. How to reliably get a bash script’s own path no matter whether the Bash script […]

Viewing all articles
Browse latest Browse all 130

Trending Articles