Using the following combination of grep
, ls
and awk
I get a list of pid that I need to kill:
grep -hP '^\d+$' `ls -lad /dir/*/pid | grep -P '/dir/\d+/pid' | awk '{ print $9 }'`
13234
18972
24322
How can I now add kill -9
command to this command combination to kill those processes?
I already using `
characters to pass awk
results to grep
command, so I assume I cannot use it again to pass it to kill
, correct?