?
Solved

grep problem

Posted on 1997-06-09
3
Medium Priority
?
467 Views
Last Modified: 2010-04-21
How can I obtain the item number X from a line returned by the command grep?
0
Comment
Question by:jjescri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Expert Comment

by:blu
ID: 2006384
Huh?  Please give an example.
0
 
LVL 1

Accepted Solution

by:
henrys earned 0 total points
ID: 2006385
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
 

Author Comment

by:jjescri
ID: 2006386
Thank you very much, U.henrys.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question