An XARGS question
Les Mikesell
lesmikesell at gmail.com
Wed Jul 19 00:41:49 UTC 2006
On Tue, 2006-07-18 at 16:50, Bill Rugolsky Jr. wrote:
> On Tue, Jul 18, 2006 at 11:31:00PM +0200, Alexander Dalloz wrote:
> > Even shorter:
> >
> > lastb -ai | awk '/Jul 18/ {print $10}' | sort -u | fgrep -x -f - blacklist
>
> Of course, in the way that I wrote it, if blacklist really only contains
> IP addresses, and is not huge, then one should reverse the order:
>
> | fgrep -x -f blacklist
>
> If blacklist is huge, and the output of the pipeline is not, or e.g., blacklist
> has multiple fields, say IP address, reason for blacklisting, etc., and one
> wants the whole record, then the order that I gave is useful.
If blacklist is sorted, why not:
lastb -ai |awk '/Jul 18/ {print $10}' |sort -u |comm -23 - blacklist
that will get you the new entries in one pass.
--
Les Mikesell
lesmikesell at gmail.com
More information about the users
mailing list