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

"Select Distinct" like command with awk or grep?

Status
Not open for further replies.

xhonzi

Programmer
Jul 29, 2003
196
US
I'm doing a grep on a table that gives me a list of computers that meet a certain criteria. The problem is that there may be duplicates in the list. If it were a SQL command on a database, I would do a "Select distinct ..." to remove the dupes. Is there a simple way with awk or grep (or something else... sed, maybe) to get the same result?

Xhonzi
 
man uniq
man sort (the -u option)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks. Gee, it seems so obvious once someone tells you...

Xhonzi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top