If your path is correctly installed on both servers, you can use /usr/bin/env :
This will use the expected result found in PATH ( /usr/bin in one case, /clearlib/vobs/otherdir/bin in another)
Instead of using env , as in the example, the interpreter is searched and found at the time the script is run.
This makes the transfer script more portable, but also increases the risk that the wrong interpreter is selected because it searches for a match in every directory in the path of the executable search.
It also suffers from the same problem that the env binary path can also be different for each machine.
And if you have a problem setting the correct PATH , then /usr/bin/env questions regarding the features of the shebang line may help.
source share