Is there a command to go inside a bash .sh
script that will provide the full path to the directory containing that script?
MacOS – Command in bash shell script to find path to that script
bashcommand linemacospathscript
Related Question
- Automator won’t execute the bash shell script
- Command not found for shell script
- MacOS – Bash script not found El Capitan
- How to pass a file set as a variable from AppleScript to a Bash shell script
- Shell variables in standalone app of bash script
- Adding shell script to $PATH is still not executing properly
Best Answer
See the answers on Get the source directory of a Bash script from within the script itself. The accepted one recommends
but reading all the answers gives a lot of alternatives (and insights into how shells work).