using SSH to run a cleartool command with agruments on remote a linux machine

和自甴很熟 提交于 2019-12-04 02:40:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!