andrelucio.fc@yahoo.com [shell-script]
2016-10-27 23:08:52 UTC
Olá, pessoal.
Estou com dificuldades para organizar certos dados que recebo e não tenho o controle para alterar como eles me são enviados.
Abaixo é a forma como recebo os dados:
G1-1 43 stations connected
IP LA1 Uptime Interface Mac Address SSID Channel HT Tx-Power Signal Avg Noise Stations
172.18.254.1 0.00 1 day, 15:10 wlan0 00:bb:ca:11:ce:21 Rede
-75 dBm -95 dBm 41
wlan1 00:aa:ca:11:ce:22 Rede
-80 dBm -95 dBm 2
Usando o sed -n l:
G1-1\t43 stations connected$
IP\tLA1\tUptime\tInterface\tMac Address\tSSID\tChannel\tHT\tTx-Power\
\tSignal Avg\tNoise\tStations$
172.18.254.1\t0.00\t1 day, 15:10\twlan0\t00:bb:ca:11:ce:21\tRede\t$
-75 dBm\t-95 dBm\t41$
\t\t\twlan1\t00:aa:ca:11:ce:22\tRede\t$
-80 dBm\t-95 dBm\t2$
E essa é forma como preciso que fique:
G1-1
IP Interface Mac Address
172.18.254.1 wlan0 00:bb:ca:11:ce:21
wlan1 00:aa:ca:11:ce:22
Tentei com o sed e outros comandos mas não conseguir me aproximar muito da forma que preciso. Se alguém conseguir me ajudar, agradeço.
Estou com dificuldades para organizar certos dados que recebo e não tenho o controle para alterar como eles me são enviados.
Abaixo é a forma como recebo os dados:
G1-1 43 stations connected
IP LA1 Uptime Interface Mac Address SSID Channel HT Tx-Power Signal Avg Noise Stations
172.18.254.1 0.00 1 day, 15:10 wlan0 00:bb:ca:11:ce:21 Rede
-75 dBm -95 dBm 41
wlan1 00:aa:ca:11:ce:22 Rede
-80 dBm -95 dBm 2
Usando o sed -n l:
G1-1\t43 stations connected$
IP\tLA1\tUptime\tInterface\tMac Address\tSSID\tChannel\tHT\tTx-Power\
\tSignal Avg\tNoise\tStations$
172.18.254.1\t0.00\t1 day, 15:10\twlan0\t00:bb:ca:11:ce:21\tRede\t$
-75 dBm\t-95 dBm\t41$
\t\t\twlan1\t00:aa:ca:11:ce:22\tRede\t$
-80 dBm\t-95 dBm\t2$
E essa é forma como preciso que fique:
G1-1
IP Interface Mac Address
172.18.254.1 wlan0 00:bb:ca:11:ce:21
wlan1 00:aa:ca:11:ce:22
Tentei com o sed e outros comandos mas não conseguir me aproximar muito da forma que preciso. Se alguém conseguir me ajudar, agradeço.