Basically I need to run the script with paths related to the shell script file location, how can I change the current directory to the same directory as where the script fil
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