I combine top
and pidof
command:
top -p $(pidof <process_name>)
If pidof <process_name>
return one id top
command works. But if pidof <process_name>
more than one ids top
command does not work.
pidof
returns ids with one space between them like : 123 124 125
If I can get these ids with comma like 123, 124, 125
top
command will work. How can I change output format of pidof
?
I know awk
was used for formatting text data. But I can not find how can I use awk
for result of shell command.