Using Ssh to Run a Cleartool Command with Agruments on Remote a Linux MAChine

pass commands server using perl openssh

That remote command expects to be run in interactive mode. This doesn't work with the SSH command mode. See this Net::OpenSSH FAQ!

You can:

  1. find a way to pass commands as arguments to that script.
  2. rewrite it to accept commands as arguments.
  3. talk to it using Expect.

Clearcase and java process : changing view does not apply

Don't use cleartool setview. It spawns a sub-shell which will make all your other command not working (since they are executed in the parent shell)

Always use the full path of a dynamic view:

/view/aView/vobs/aVob/....

You will find the very same issue (and the very same advice "don't use setview") in:

  • "Dynamic views of ClearCase not integrating in Jenkins"
  • "using SSH to run a cleartool command with agruments on remote a linux machine"
  • "script doesn't run while executing in clearcase"

You will find a concrete example of that issue in "Python and ClearCase setview".

Executing an Expect script from different locations

If your path is correctly set on both servers, you could use /usr/bin/env:

#!/usr/bin/env expect

That would use the expect as found in the PATH (/usr/bin in one case, /clearlib/vobs/otherdir/bin in the other)

By instead using env as in the example, the interpreter is searched for and located at the time the script is run.

This makes the script more portable, but also increases the risk that the wrong interpreter is selected because it searches for a match in every directory on the executable search path.

It also suffers from the same problem in that the path to the env binary may also be different on a per-machine basis.

And if you have issue with setting the right PATH, then "/usr/bin/env questions regarding shebang line pecularities" can help.



Related Topics



Leave a reply



Submit