I am trying to run my Expect script from two different locations and it will work with the following Expect executables referenced:
- My linux home directory (
#!/usr/bin/expect) - A clearcase view on another server (
#!/clearlib/vobs/otherdir/bin/expect)
The problem is that I cannot run the script in both places unless I change the reference of the Expect executable location to the first line of the file.
How can I get the correct instance of the Expect executable for the corresponding directory?
If your path is correctly set on both servers, you could use
/usr/bin/env:That would use the expect as found in the
PATH(/usr/binin one case,/clearlib/vobs/otherdir/binin the other)And if you have issue with setting the right
PATH, then “/usr/bin/envquestions regarding shebang line pecularities” can help.