linux - Finding an exact match in QNX without using grep -w -
i'm writing script needs find exact match in file compatible qnx , posix compliant linux
more detail:
im trying find user of process original command wrote
user=$(ps -aux | awk '{print $1 " " $2}' | grep -w ${process} | awk '{}print $1')
which works in posix compliant linux
however, qnx isn't totally posix compliant , grep -w
isn't usable target...so need find exact match without grep -w
i think want print field 1 if field 2 matches something:
ps -aux | awk -v p=$process '$2==p{print $1}'
Comments
Post a Comment