shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Ordenar por Matches


From: Darlon Vasata
Subject: Re: [shell-script] Ordenar por Matches
Date: Thu, 17 Mar 2011 11:42:11 -0300

Olá Maiquel

Uma possível solução seria utilizar o awk para colocar os números na primeira 
coluna, e depois ordenar com o sort.

awk '{print $(NF-1), $0}' arq | sed 's/^.//'  | sort -n

92 permit tcp any host xx eq 3389 (92 matches)
8179 permit ip host xx any (8179 matches)
14538 permit ip host xx any (14538 matches)
110428 permit ip host xx any (110428 matches)
242840 permit tcp host xx any (242840 matches)
1326387 permit ip host xx any (1326387 matches)

Essa substituição do primeiro caractere da coluna pode ser feita diretamente no 
awk e otimizar a execução, mas isso eu deixo para você :)



Em 17/03/2011, às 11:27, Maiquel Consalter escreveu:

> permit ip host xx any (8179 matches)
> permit ip host xx any (1326387 matches)
> permit ip host xx any (14538 matches)
> permit ip host xx any (110428 matches)
> permit tcp host xx any (242840 matches)
> permit tcp any host xx eq 3389 (92 matches)



[As partes desta mensagem que não continham texto foram removidas]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]