filter\move
时间:2007-12-25 来源:061107
#!awk -f
{
ip=$1
i=index($0,"\"Mozilla")
if (i>1)
{
ua = substr($0,i)
print ip " - " ua
}
}
#!/usr/bin/awk -f
{
if (NF>8)
{
if ($9 ne "AW2)")
print $10
}
} #move.sh #!/bin/sh
len=`wc -l < /data_tape/data1/lst/lst.$1`
mkdir /data_tape/data1/$1
n=1
while test "$n" -le "$len"
do
file=`tail +$n /data_tape/data1/lst/lst.$1 | head -1`
echo "$file"
n=`expr $n + 1`
#dir=/data/$file
#[ !-d $dir ] && dir=/data2/$file
cp -Rf /data_tape/data1/$file /data_tape/data1/$1/
done
#filter.sh
#!/bin/sh
dir="/data1/${1}"
#rm ${1}.txt
for filename in `find $dir -name '*.txt' -type f`
do
#cat $filename | awk '{i=index($0,"Mozilla");if(i>1)print $1}' >>${1}${DR}.ip.txt
#cat $filename | awk '{if(NF>8){if($9 ne "AW2")print $10}}' >>a.txt
cat $filename | grep -v 'AW2)$' | grep -v 'Windows)$' >>${1}.txt
//grep -v '5\.[10])$'
#expr "$t" : '.*\(.*\))' >>a.txt
#expr "$t" : '.*;\(.*\))' >>a.txt
done #Mozilla.sh #!/bin/sh
len=`wc -l < ./lst/lst.$1`
#DR=`date +"%y%m%d%H%M"`
#rm ${1}${DR}.log
#rm ${1}${DR}.ip.txt
echo $len >>${1}${DR}.log
echo '----------------------------' >>${1}${DR}.log
n=1
while test "$n" -le "$len"
do
file=`tail +$n ./lst/lst.$1 | head -1`
n=`expr $n + 1`
echo $file >>${1}${DR}.log
echo $file 2 >>${1}${DR}.err.log
for filename in `find $file -name "*.txt" -type f`
do
cat $filename | awk '{i=index($0,"Mozilla");if(i>1)print $1}' >>${1}${DR}.Mozilla
done
done
{
ip=$1
i=index($0,"\"Mozilla")
if (i>1)
{
ua = substr($0,i)
print ip " - " ua
}
}
#!/usr/bin/awk -f
{
if (NF>8)
{
if ($9 ne "AW2)")
print $10
}
} #move.sh #!/bin/sh
len=`wc -l < /data_tape/data1/lst/lst.$1`
mkdir /data_tape/data1/$1
n=1
while test "$n" -le "$len"
do
file=`tail +$n /data_tape/data1/lst/lst.$1 | head -1`
echo "$file"
n=`expr $n + 1`
#dir=/data/$file
#[ !-d $dir ] && dir=/data2/$file
cp -Rf /data_tape/data1/$file /data_tape/data1/$1/
done
#filter.sh
#!/bin/sh
dir="/data1/${1}"
#rm ${1}.txt
for filename in `find $dir -name '*.txt' -type f`
do
#cat $filename | awk '{i=index($0,"Mozilla");if(i>1)print $1}' >>${1}${DR}.ip.txt
#cat $filename | awk '{if(NF>8){if($9 ne "AW2")print $10}}' >>a.txt
cat $filename | grep -v 'AW2)$' | grep -v 'Windows)$' >>${1}.txt
//grep -v '5\.[10])$'
#expr "$t" : '.*\(.*\))' >>a.txt
#expr "$t" : '.*;\(.*\))' >>a.txt
done #Mozilla.sh #!/bin/sh
len=`wc -l < ./lst/lst.$1`
#DR=`date +"%y%m%d%H%M"`
#rm ${1}${DR}.log
#rm ${1}${DR}.ip.txt
echo $len >>${1}${DR}.log
echo '----------------------------' >>${1}${DR}.log
n=1
while test "$n" -le "$len"
do
file=`tail +$n ./lst/lst.$1 | head -1`
n=`expr $n + 1`
echo $file >>${1}${DR}.log
echo $file 2 >>${1}${DR}.err.log
for filename in `find $file -name "*.txt" -type f`
do
cat $filename | awk '{i=index($0,"Mozilla");if(i>1)print $1}' >>${1}${DR}.Mozilla
done
done
相关阅读 更多 +