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!

sort -u in awk

Status
Not open for further replies.

marsd

IS-IT--Management
Apr 25, 2001
2,218
US
I have a situation where I would rather write
the filter effect of sort -u into an awk
script-how does one do this?

say output looks like this:

[date] [error] [client address] /string/.*

script looks like this:

awk -v x=$(date) ' {
if ($0 ~ x) {
right = $0
}
split(right, arr, /\[.*\] \[error\]/)
for (a in arr) {
now the sort code that I can't figure out..
print arr[a]
}
}' textfile

TIA
MMD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top