The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: nawk help
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 02-11-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Quote:
Originally Posted by beppler View Post
OK fixed the syntax error but
what I was hoping for is something like this
IP address (Field 5) then the "S" Files
ie:
196.196.1.10 S*
196.196.1.10 S*
196.196.1.10 S*
196.196.1.10 S*
196.196.1.11 S*
196.196.1.11 S*
196.196.1.11 S*
196.196.1.11 S*
Sorry, I have no idea what the "S" files are and I don't have a sample file you're trying to parse...
In your original code you're outputting the ENTIRE line (print $0) if the NINTH field is one of the matched strings.
And I think you wanted to output the 5-th field if the frst field is 'running'.

This is what I coded based on your explanation and a piece of code you've given.

If want you can provide a sample data file, a desired output and a description (once again) of what you're trying to achieve.
Please use vB Codes when posting any data samples.