After further investigation it is specifically the "dirname $0" that is causing the issue, and appears to be related to the terminal I'm using. As if I run gnome-terminal this works as expected but with terminator it doesn't.
gnome-terminal $ dirname $0 .
terminator $ dirname $0 /bin
After further investigation it is specifically the "dirname $0" that is causing the issue, and appears to be related to the terminal I'm using. As if I run gnome-terminal this works as expected but with terminator it doesn't.
gnome-terminal
$ dirname $0
.
terminator
$ dirname $0
/bin