I want to attach to a running process using \'ffffd\', what I manually do is:
# ps -ax | grep PROCESS_NAME
Then I get a list and the pid, the
You can use awk to both filter and get the column you want. The "exit" limits the ps results to the first hit.
function ffffd_grep() {
ffffd $(ps -ax | awk -v p="$1" '$4 == p { print $1; exit 0; }');
}
ffffd_grep PROCESS_NAME
You may have to adjust the columns for your ps output. Also you can change the ==
to ~
for regex matching.