RE: Quick question on awk usage





-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Bliss, Aaron
Sent: Tuesday, June 27, 2006 11:03 AM
To: redhat-list@xxxxxxxxxx
Subject: RE: Quick question on awk usage

Sorry, $14 == 528, not $12 (looks like the email client
wrapped the line
also)

Aaron

Hi everyone, I have a quick question on using awk from the
command line; I have a tab delimited file, and would like to
know the syntax to print the entire line only when $12 ==
575; the syntax from the command line to print only $1 would
be cat security.log | awk '{print $1}' ; any ideas (grepping
for 578 won't be good enough since it's possible that
578 could appear somewhere else in the file) Thanks very much.

Aaron

Jun 25 15:54:02 ms-unix-s02.preferredcare.org MSWinEventLog 4
Security 263985 Sun Jun 25 15:54:02 2006 528
Jun 25 15:54:02 ms-unix-s02.preferredcare.org MSWinEventLog 4
Security 263985 Sun Jun 25 15:54:02 2006 575



I believe this should do it:

awk ' $14 == 575 {print $0}'

Michael

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



Relevant Pages

  • Quick question on awk usage
    ... I have a quick question on using awk from the command line; ... I have a tab delimited file, and would like to know the syntax to print ...
    (RedHat)
  • RE: Quick question on awk usage
    ... Quick question on awk usage ... I have a quick question on using awk from the command line; ... I have a tab delimited file, and would like to know the syntax to print ...
    (RedHat)
  • Re: Accesing structures data (getting lengthy!)
    ... According to the syntax you ... assignment statement just won't stand out amongst all the other ... meaningless dummy variables that you have to keep track of. ... comparitively easy to pick out of a long, boring, command line history, ...
    (comp.soft-sys.matlab)
  • Re: Windows could not upgrade the file..........Security update KB
    ... "Sky King" wrote in message ... > Robert Aldwinckle wrote: ... I would not have offered my tip about copying text from a command ... probably over a simple syntax error. ...
    (microsoft.public.windowsupdate)
  • Re: krb5kdc_err_s_principal_unknown on Windows Kerberos Domain
    ... command line with the parameter "tickets". ... fail group policy replication for users. ... I went to the command line and tested this unusual syntax, ...
    (comp.protocols.kerberos)