简体   繁体   English

在我的某些服务器列表的bash循环中,脚本在使用ssh执行perl脚本后退出

[英]In my bash loop over a list of some servers the script exits after execution a perl script with ssh

I have a problem similiar to this one: 我有一个与此类似的问题:

in my bash loop over a list of some servers, if the ssh connects the bash script exits 在我的bash循环中,一些服务器的列表上,如果ssh连接,则bash脚本退出

Unfortunately ssh is called from a perl script I can't edit (so I won't be able to add -n to ssh commad). 不幸的是, ssh是从我无法编辑的perl脚本中调用的(因此,我无法在ssh commad中添加-n )。

What else could be done? 还有什么可以做的?

在您的路径中放置一个伪造的ssh ,将调用委派给真实的ssh并添加-n

I did: 我做了:

my_script < /dev/null  

and it works just fine. 而且效果很好。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM