General discussion


Which script am I actually running

By sdlewis ·
I need a UNIX command that when called from a script will allow me to know which directory the script is being run from. Our versioning for production and test is simply to use different directory path. If I use which, it will simply tell me which one is in my path first. Right now I use pwd. The problem with pwd is that it will only tell me where it was called from. I want the script to be able to be called from anywhere. I have tried to compensate for that by checking $0 as well, but that will backfire if someone calls the test script from the production path. This is a ksh script.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums