当我尝试在远程主机上结合另一个命令执行pkill时,即使两个命令都成功,它也始终返回255。
ssh <remoteHost> 'pkill -f xyz' # returns 0 (rightly so when xyz is a process)
Run Code Online (Sandbox Code Playgroud)ssh <remoteHost> 'source /etc/profile' # returns 0 (rightly so)
Run Code Online (Sandbox Code Playgroud)但是当我运行组合命令时:
ssh <remoteHost> 'source /etc/profile; pkill -f xyz' # returns 255 - why?
Run Code Online (Sandbox Code Playgroud)关于“ pkill”与另一条命令的结合是有一些问题的,因为即使结合使用,以下内容也会返回零:
ssh <remoteHost> 'source /etc/profile; ls' # returns 0
Run Code Online (Sandbox Code Playgroud)假设xyz当我们试图杀死它时,它始终在运行。
我不了解这种行为。为什么在情况3中返回255?