English 中文(简体)
使用commons-exec的一系列命令
原标题:series of commands using commons-exec

我是apachecommons执行官的新手。

有没有一种方法可以将一系列命令发送到远程机器,而无需每次进行身份验证?

想做这个订单:

ssh a@b
command1
command2

但显然commons exec需要这样:

ssh a@b 
 command1
ssh a@b 
 command2

知道吗?

最佳回答

尝试

ssh a@b "command1; command2"

这是在脚本中通过ssh在远程系统上执行多个命令的常见方法。这也适用于您的案例。

问题回答

暂无回答




相关问题
Deciding between Apache Commons exec or ProcessBuilder

I am trying to decide as to whether to use ProcessBuilder or Commons exec, My requirements are that I am simply trying to create a daemon process whose stdout/stdin/stderr I do not care about. In ...

Streaming output with commons-exec?

Can anyone give me an example of how to stream the output of an external program executed with DefaultExecutor? I m not finding any documentation describing how to do this. My external process will ...

commons-exec: Executing a program on the system PATH?

I m trying to execute a program (convert from ImageMagick, to be specific) whose parent folder exists on the path. Ergo, when I run convert from the command line, it runs the command. The following, ...

热门标签