when I execute the cmd ps -U root -u root -eo pid I get the output in multiple lines
Eg: 1 2 3 4
I would like to see the output in one line as 1,2,3,4,5 ...
when I execute the cmd ps -U root -u root -eo pid I get the output in multiple lines
Eg: 1 2 3 4
I would like to see the output in one line as 1,2,3,4,5 ...
No need external command
var=$(ps -U root -u root -eo pid )
echo ${var//$'\n'/,}