2017-03-05 2 views
0

J'essaie dans ce termnial:tuyau pour tuer commande

/tmp ps x | grep -m1 firefox | cut -d' ' -f1 | kill -KILL  
kill: not enough arguments 

Comment puis-je le tuyau pid tuer?

J'ai essayé, ne fonctionne pas

/tmp ps x | grep -m1 firefox | kill -KILL $(cut -d' ' -f1) 
cut: -: Input/output error 
kill: not enough arguments 

Répondre

0

Vous pouvez utiliser xargs. Cela lit la sortie de commande1 et l'utiliser comme arguments pour exécuter commande2:

command1 | xargs command2 

Dans votre cas

ps x | grep -m1 firefox | cut -d' ' -f1 | xargs kill -KILL