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
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