Работа над проектом Linux [закрыто]

Я изменил код, приведенный в OP:

awk '{print $3}' input.txt | sort -u | while read line
do 
    echo -n `grep $line input.txt | \
      sort -r | head -1 | \
      grep -oe "[^a-z]*"` ' ' # print latest time stamp
    if [[ $(grep -c $line input.txt) -ge 2 ]];  then 
        echo  'both'
    else
        echo `grep $line input.txt | grep -oe "[a-z]*"`
    fi
done

Выход:

2014-11-24 12:59:42.169 101.0.0.0  source
2014-11-24 12:59:40.375 104.156.80.0  destination
2014-11-24 12:59:36.729 104.219.48.0  destination
2014-11-24 12:59:40.377 104.37.160.0  source
2014-11-24 12:59:06.456 107.188.128.0  both
2014-11-24 12:59:42.043 107.192.0.0  both
2014-11-24 12:59:33.209 108.175.32.0  both
2014-11-24 12:59:55.488 111.0.0.0  both
2
28.06.2011, 13:24
0 ответов

Теги

Похожие вопросы