grep problem

How can I obtain the item number X from a line returned by the command grep?
jjescriAsked:
Who is Participating?
 
henrysConnect With a Mentor Commented:
pipe output of grep to awk
For example, to get the process ID from a `ps` listing:
% ps -ef | grep inetd | awk '{print $2}'  (SysV)
 ps -aux | grep inetd | awk '{print $2}'   (BSD)
0
 
Brian UtterbackPrinciple Software EngineerCommented:
Huh?  Please give an example.
0
 
jjescriAuthor Commented:
Thank you very much, U.henrys.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.