shell脚本接受输入
while read var do cat logs | grep IconsendRedirect | grep $var | awk -F' ' '{print $8}' | wc -l cat logs | grep IconsendRedirect | grep $var | awk -F' ' '{print $8}' | awk '!a[$0]++' | wc -l done
根据某列字段过滤不重复后统计总数和输出
cat logs | grep IconsendRedirect | grep 105011 | awk -F' ' '!a[$8]++' | wc -l >> text.txt
cat logs | grep IconsendRedirect | grep 105011 | awk -F' ' '!a[$8]++' >> text.txt
cat logs | grep IconsendRedirect | grep $var | awk -F' ' '{print $8}' | awk '!a[$0]++'