sed awk或perl为此? [英] sed awk or perl for this?
问题描述
我有一个输出以下内容的脚本。
200 23.131.155.5;
1 23.131.161.4;
2 102.131.161.54;
2 23.160.180.4;
35 54.1.8.7;
356 15.18.235.52;
1 205.18.235.88;
1 205.18.246.21;
1 205.18.247.121;
9 207.89.177.202;
6 27.89.177.234;
2 208.7.71.85;
1 23.3.17.30;
4 210.92.146.15;
2 21.126.142.17;
3 22.180.255.20;
第一列是no。第2栏中的主持人做过的时间
不应该做的事情。我只需要看到主人
做了很多不好的事情而不是一两次所以我是
寻找像这样的东西。
../scripts.sh | < somecommand过滤并向我显示的行是
的第一列多于一个字符。>
200 23.131.155.5;
35 54.1.8.7;
356 15.18.235.52;
任何想法?
谢谢。
I have a script that outputs the following.
200 23.131.155.5;
1 23.131.161.4;
2 102.131.161.54;
2 23.160.180.4;
35 54.1.8.7;
356 15.18.235.52;
1 205.18.235.88;
1 205.18.246.21;
1 205.18.247.121;
9 207.89.177.202;
6 27.89.177.234;
2 208.7.71.85;
1 23.3.17.30;
4 210.92.146.15;
2 21.126.142.17;
3 22.180.255.20;
The first colums is the no. of time a host in column 2 has did
something that is was not supposed to do. I only need to see hosts
that did bad things significant times not one or two time so I am
looking for somehthing like this.
../scripts.sh | <somecommand that filters and just show me lines that
has first colum more then one char.>
200 23.131.155.5;
35 54.1.8.7;
356 15.18.235.52;
any ideas?
Thanks.
推荐答案
2003年9月11日06:48:06 -0700, ne******@yahoo.com (NNTP)写道:
On 11 Sep 2003 06:48:06 -0700, ne******@yahoo.com (NNTP) wrote:
第一列是no。第2列中的主持人所做的事情是不应该做的事情。我只需要看到那些做过不好事的主人,而不是一两次,所以我在寻找像这样的东西。
任何想法?
The first colums is the no. of time a host in column 2 has did
something that is was not supposed to do. I only need to see hosts
that did bad things significant times not one or two time so I am
looking for somehthing like this. any ideas?
我不知道sed或awk,但是:
perl -e ''while(<>)
{(
I don''t know sed or awk, but:
perl -e ''while (<>)
{ (
num,
ip)= split;下一个if(
ip)=split; next if (
这篇关于sed awk或perl为此?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!