I would like to know how to capture the output of this command into a variable
ssh -q $ssh_host 'ps -eo comm,lastcpu'
Once the information is captured, I want to check the variable if it returned more then one result and label it
Example
rpciod/0 0 rpciod/1 1 rpciod/2 2 rpciod/3 3
After processing I want the output to be
it adds the hostname and puts the output on separate line, removing /1 /2 if it find it
Hostname1 being the value of $ssh_host
hostname1 rpciod 0 hostname1 rpciod 1 hostname1 rpciod 2 hostname1 rpciod 3