[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

grep problem

Posted on 1997-06-09
3
Medium Priority
?
473 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

656 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