NiceButDim
Programmer
I have a problem; I have a c program that must call a shell script. This script resides in more than once place. Within the script itself I need to be able to determine the directory where it is being run from.
I know that I can use $0 to see the name of the script as used when it was called. However this MAY not always be sufficient as a full pathname is not always used to call the script. Using a combination of $0 and pwd I can construct the path. However I was wondering if anyone knew of a simpler way of determing the path of a running script.
Thanks.
john.
I know that I can use $0 to see the name of the script as used when it was called. However this MAY not always be sufficient as a full pathname is not always used to call the script. Using a combination of $0 and pwd I can construct the path. However I was wondering if anyone knew of a simpler way of determing the path of a running script.
Thanks.
john.