简体   繁体   English

使用SSH在远程Linux机器上运行带有Agruments的cleartool命令

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

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: 但是,如果像这样在exec之后有两个以上的参数:

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" 那么它将失败并显示以下错误:额外参数:“ 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. 所以现在,如果在-exec之后有两个以上的参数,那么它将说那些参数是多余的,任何人都知道我可以解决这个问题。 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. 我认为程序认为第一个参数是我要设定的观点。

Don't try to use setview : it spawns a sub-shell, which won't ever work well with multiple commands. 不要尝试使用setview :它会生成一个子shell,它不能与多个命令一起很好地工作。
See " Python and ClearCase setview " for a concrete example of the kind of issue you will have. 有关您将遇到的问题的具体示例,请参见“ Python和ClearCase setview ”。

Simply use the full path of a dynamic view , as I mention in " script doesn't run while executing in clearcase ". 只需使用动态视图完整路径即可 ,正如我在“ 脚本在用clearcase执行时不会运行 ”中提到的那样。

/view/aView/vobs/...

Make sure that this view is started first ( cleartool startview ) 确保首先启动此视图( cleartool startview

No need for setview here. 这里不需要setview

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Java在远程机器上运行linux命令 - Run linux command in remote machine from java 如何在命令中传递多个参数以使用C / C ++和SSH在远程Linux计算机上执行exe - How to pass multiple arguments in a command to execute an exe on remote linux machine using C/C++ and SSH 使用Native Mac App在远程Linux机器上执行SSH命令。 (对象 - C) - Execute SSH Command on remote Linux Machine using Native Mac App. (Obj-C) GitHub 对 SSH 的操作进入由 terraform 创建的 linux 机器并在其上运行远程命令 - GitHub Actions to SSH into a linux machine created by terraform and run remote commands on it 通过 ssh 从远程 linux 机器运行本地 python 脚本 - run local python script from remote linux machine over ssh 在远程SSH虚拟机上运行命令并在本地存储响应 - Run command over remote ssh virtual machine and store response locally 使用esh使用ssh连接到远程机器[linux server] - using eclipse to connect to remote machine[linux server] using ssh SSH远程机器并执行命令 - SSH remote machine and execute command 使用配置文件的ssh命令在远程机器中执行shell脚本 - Execute shell script in remote machine using ssh command with config file 从Java在远程Linux机器上运行进程(命令) - run process (command) on a remote linux machine from java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM