shell change directory in script code example
Example 1: bash change to script directory
cd "$(dirname "${BASH_SOURCE[0]}")"
Example 2: bash script change directory run a command
cd DIRECTORY_HERE; COMMAND_WITH_ARGS_HERE
cd "$(dirname "${BASH_SOURCE[0]}")"
cd DIRECTORY_HERE; COMMAND_WITH_ARGS_HERE