问题
when I run this then everything work:
C:\PROGRA~1\cwRsync\bin\ssh.exe -o 'StrictHostKeyChecking no' 10.10.10.10 -l username /usr/atria/bin/cleartool setview -exec 'pwd' cm_myview
however if I have more than two arguments after exec like this:
C:\PROGRA~1\cwRsync\bin\ssh.exe -o 'StrictHostKeyChecking no' 10.10.10.10 -l username /usr/atria/bin/cleartool setview -exec 'cd /user' cm_myview
then it will fail with the error: extra argument:"cm_myview"
so right now if there is more than 2 argument after -exec, then it will say those argument are extra, anyone know how I can fix this. Thanks.
I am only running one command which run a script file. But I need to pass arguments to this script file. I think the program think the first argument is the view i am tying to set.
回答1:
Don't try to use setview
: it spawns a sub-shell, which won't ever work well with multiple commands.
See "Python and ClearCase setview" for a concrete example of the kind of issue you will have.
Simply use the full path of a dynamic view, as I mention in "script doesn't run while executing in clearcase".
/view/aView/vobs/...
Make sure that this view is started first (cleartool startview
)
No need for setview
here.
来源:https://stackoverflow.com/questions/23093097/using-ssh-to-run-a-cleartool-command-with-agruments-on-remote-a-linux-machine