An XARGS question

Philip Walden pwaldenlinux at pacbell.net
Tue Jul 18 19:49:33 UTC 2006


Michael Yep wrote:

>Hello
>
>Is there a way to have xargs or perhaps another tool take a list from
>stdin and put it somewhere besides the last argument?
>
>Say if i want to get all the offending IPs (bad logins) for a given day
>then i want to take that list and see if its in a file called blacklist
>
>lastb -ai |fgrep "Jul 18" |awk '{print $10 }'|sort|uniq | xargs grep ???
>blacklist
>
>where ??? would be where the stdin goes
>
>  
>
  lastb -ai |fgrep "Jul 18" |awk '{print $10 }'|sort|uniq | xargs 
--max-args=1 -i\?\?\? grep \?\?\? blacklist




More information about the fedora-list mailing list