How to transform multiple line into one line in bash stdout ?

Posted by Samantha on Stack Overflow See other posts from Stack Overflow or by Samantha
Published on 2010-02-08T19:30:28Z Indexed on 2010/03/13 21:55 UTC
Read the original article Hit count: 330

Filed under:
|

Hello,

I sometimes do this in my shell :

sam@sam-laptop:~/shell$ ps aux | grep firefox | awk '{print $2}'
2681
2685
2689
4645

$ kill -9 2681 2685 2689 4645

Is there a way I can transform the multiple lines containing the PIDs into one line separated by spaces ? (It's a little bit annoying to type the PIDs every time and I really would like to learn :) )

Thanks a lot.

© Stack Overflow or respective owner

Related posts about shell

Related posts about bash