Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep for pattern get the next line

Status
Not open for further replies.

dwcasey

MIS
Oct 31, 2002
179
US
This is on AIX, so I don't have GNU grep. I need to search for differing application versions. Application name is on one line, version is on the next. Something like:

aa This is an application to do stuff
aix Version: 11.22.33.44

There is some unique data on the application line, so I can grep it out, but I need to add the line after. Actually, all I need is the version number line, just using the application name to find it.
 
I also have been looking at piping my output to awk '/application name/' and then trying to get the next line.
 
ok, pretty sad, but I'm replying to my own post. if someone comes up with other ways to do this, I would be interested.

I ended up piping my out to awk:

awk '/Application Name/{getline;print}'

And I only get the line with the application version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top