I want to look for a specific process and then kill it (in a script).
I'm doing ps -fu user | grep matching_string
but this is returning me two rows: one for the expected pid and another for the pid of the grep.
If the result were two columns, I would use awk to pick the first one. But I don't know how to pick the first result when they are returned as row.