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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk and multiple regular expression in specific field 1

Status
Not open for further replies.

unprophete

Technical User
Apr 9, 2010
31
0
0
DE
I need to get lines which have not "active" or "online" on 6th field. Is the below command reliable?

awk '$6 != "active" || $6 != "online" {print $0}' filename


or maybe it can be changed with something with single $6 in the command like:

awk '$6 != ""active" || "online"" {print $0}' filename

????

thank you.
 
I'd try simply this:
Code:
awk '$6!="active" && $6!="online"' filename

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top