incoquinita
(usa Debian)
Enviado em 26/07/2011 - 10:20h
Bom dia
Estou precisando mover uma serie de strings para o final de uma linha.
A entrada que eu tenho esta logo a seguir, que é um segmento do dhcpd.conf:
{ ##WS001798 ##hardware ethernet 00:08:54:xx:xx:xx ; #hardware ethernet 00:1e:c9:xx:xx:xx ; hardware ethernet 00:55:33:xx:xx:xx ; #fixed-address 192.168.xx.xx ; fixed-address 192.168.xx.xx }
O que eu preciso fazer, preciso pegar tudo que seja comentario e mover para depois do '}'. Eu consigo localizar tudo de uma só vez, da seguinte forma: egrep -i -o '(#[0-9a-z :.;-_]{1,})'
Mas o problema é que ele encontra tudo.
Resumindo:
Eu tenho:
{ ##WS001798 ##hardware ethernet 00:08:54:xx:xx:xx ; #hardware ethernet 00:1e:c9:xx:xx:xx ; hardware ethernet 00:55:33:xx:xx:xx ; #fixed-address 192.168.xx.xx ; fixed-address 192.168.xx.xx }
Preciso que fique assim:
{ hardware ethernet 00:55:33:xx:xx:xx ; fixed-address 192.168.xx.xx } #WS001798 #hardware ethernet 00:08:54:xx:xx:xx ; #hardware ethernet 00:1e:c9:xx:xx:xx ; #fixed-address 192.168.xx.xx ;