$ cat script.sh #!/usr/bin/env bash THIS_FILE=$(readline -e $) THIS_DIR=$(dirname $THIS_FILE) echo $THIS_DIR source
$ cat script.sh #!/usr/bin/env bash THIS_FILE=$(readline -e $) THIS_DIR=$(dirname $THIS_FILE) echo $THIS_DIR source