我在termnial中尝试了一下:
/tmp ps x | grep -m1 firefox | cut -d' ' -f1 | kill -KILL
kill: not enough arguments我怎么才能用管道把pid杀死?
我试过了,不管用
/tmp ps x | grep -m1 firefox | kill -KILL $(cut -d' ' -f1)
cut: -: Input/output error
kill: not enough arguments发布于 2017-03-06 00:28:32
您可以使用xargs。这将读取command1的输出,并将其用作运行command2的参数:
command1 | xargs command2在你的情况下
ps x | grep -m1 firefox | cut -d' ' -f1 | xargs kill -KILL https://stackoverflow.com/questions/42607320
复制相似问题