Re: An XARGS question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux