我想pdsh
用来断言命令在多个节点上成功运行,如果命令在任何节点上失败,则退出代码(from pdsh
)应该是非零的。
考虑以下示例:
$ pdsh -w host1,host2 "exit 0"; echo $?
host1: host1
host2: host2
0
$ pdsh -w host1,host2 "exit 1"; echo $?
host1: host1: ssh exited with exit code 1
host2: host2: ssh exited with exit code 1
0
$ pdsh -w host1,host2,host3 "exit 1"; echo $?
host1: host1: ssh exited with exit code 1
host2: host2: ssh exited with exit code 1
host3: host3: ssh exited with exit code 255
0
第二个示例应返回非零退出代码。
在第三个示例host3
中不存在并且退出代码仍然为零。
我错过了什么吗?
谢谢