[olug] script help

Christopher Cashell topher-olug at zyp.org
Wed Feb 20 06:52:24 UTC 2008


Well, for a super quick and dirty result, you could do something like:

#!/usr/bin/awk -f
# vim: ts=3 sw=3 et sm ai smd sc bg=dark
BEGIN {
   RS = "@d."
}
/51 running/ {
   print $0
}
### End Script ###

In this case, it will match any entries with '51 running' in between
the @d's.  We're telling awk to use "@d" as a record separator, and
any time we match our search string (as specified in the script), we
print the results. [Note: I chose '51 running' simple because it was a
difference between the two examples for test purposes.]

In some ways, this would actually be easier if the separator was
always identical, and didn't contain a different start/stop separator,
but this might just do the trick.

-- 
Christopher



More information about the OLUG mailing list