Shell Script Examples

How to find the directory of the script

#!/bin/bash
MY_PATH="`dirname \"$0\"`"

$MY_PATH/relative/path/to/other/file

pass arguments on to another script

$@

for example

#!/bin/bash
MY_PATH="`dirname \"$0\"`"

python3 $MY_PATH/my-script.py "$@"