SyntaxFix
Write A Post
Hire A Developer
Questions
An earlier comment on an answer said it, but it is easy to miss among all the other answers.
When using bash:
echo this file: "$BASH_SOURCE" echo this dir: "$(dirname "$BASH_SOURCE")"
Bash Reference Manual, 5.2 Bash Variables