Sourcing in the "export_modules_dir.sh" script causes $0 to be "bash" in gnome-terminal and "/bin/bash" in terminator. When executing the script $0 is ./export_modules_dir.sh as one would expect.
Since the script is being sourced in I don't think it dirname should be used.
Sourcing in the "export_ modules_ dir.sh" script causes $0 to be "bash" in gnome-terminal and "/bin/bash" in terminator. When executing the script $0 is ./export_ modules_ dir.sh as one would expect.
Since the script is being sourced in I don't think it dirname should be used.
http:// unix.stackexcha nge.com/ questions/ 4650/determinin g-path- to-sourced- shell-script