I'm trying to figure out how to get a list of pids of multiple processes:
pidof proc1
1234 4321 7665
pidof proc2
3312 445
and take all this pids, where there are multiple instances of multiple processes and combine them and then feed them all into the kill command. Since kill can take multiple pids as input, I was hoping I could do this without a for-each loop:
kill -SIGKILL echo $(pidof proc1; pidof proc2)
but I just get "bash: kill: echo: arguments must be process or job IDs" error message. I'm very new to bash scripting so I'm sure there's just something obvious I'm not thinking of.