Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux ant sshexec任务在命令返回时是否返回';是执行返回还是之前?_Linux_Ant - Fatal编程技术网

Linux ant sshexec任务在命令返回时是否返回';是执行返回还是之前?

Linux ant sshexec任务在命令返回时是否返回';是执行返回还是之前?,linux,ant,Linux,Ant,基本上,我在ant目标中有两个sshexec任务,一个接一个。第一个在一台机器上启动消息发送器,第二个在另一台机器上启动消息接收器。 我假设sshexec任务将发出命令运行消息发送方,然后在发送方运行时返回,然后下面的sshexec任务将启动接收方,因此发送方和接收方将并行运行,这是我希望实现的,但我不确定是否真的是这样,或者,事实上,第一个任务只有在发送方返回时才会返回,因此接收方只有在发送方完成执行后才能启动 sshexec任务页面似乎没有提供太多信息,而且我对mac有点陌生(这些命令是在运

基本上,我在ant目标中有两个sshexec任务,一个接一个。第一个在一台机器上启动消息发送器,第二个在另一台机器上启动消息接收器。 我假设sshexec任务将发出命令运行消息发送方,然后在发送方运行时返回,然后下面的sshexec任务将启动接收方,因此发送方和接收方将并行运行,这是我希望实现的,但我不确定是否真的是这样,或者,事实上,第一个任务只有在发送方返回时才会返回,因此接收方只有在发送方完成执行后才能启动

sshexec任务页面似乎没有提供太多信息,而且我对mac有点陌生(这些命令是在运行macos 10的MacMini上发布的),因此非常感谢您的帮助,谢谢

    <!--start sender-->
    <sshexec host="${ip.client3}"
                 username="${username}"
                 password="${userpassword}"
                 trust="true"
                 command="./sender"
    />

    <!-- start receiver-->
    <sshexec host="${ip.client4}"
                 username="${username}"
                 password="${userpassword}"
                 trust="true"
                 command="./receiver "
    />

远程命令返回后,任务将返回

如果您只想同时启动这两个命令,可以使用
任务。嵌套在
任务中的任何任务都将通过多线程“同时”运行。但是,这样,
仍然需要等待这两个命令返回

如果您只想让ant脚本启动这两个命令并在不等待远程命令返回的情况下继续构建,您可以在命令行中使用类似于
nohup
的东西

我不确定nohup是否有效,因为当我使用nohup从ssh终端运行远程命令时,如下所示:

nohup command & [ENTER]
在开始使用同一终端执行其他操作之前,我必须再次按enter键