I have this output:
eth-g0 Link encap:Ethernet HWaddr 44
inet addr:222.222.22.22 Bcafdst:0.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500
RX packets:9073618 errors:0 dropped:0 overruns:0
TX packets:6846448 errors:0 dropped:0 overruns:0
collisions:0 txqueuelen:1000
RX bytes:16fd45599237 (1.99 GiB) TX bytes:1937392674 (1.8
Interrupt:36
eth-g1 Link encap:Ethernet HWaddr 44
inet addr:22.222.222.22 Bcast:0.2.2.2
UP BROADCAST MULTICAST MTU:1500
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0
collisions:0 txqueuelen:1200
RX bytes:0 (0.0 b) TX bytes:0 (0.0
Interrupt:37
I need this output:
eth-g0 inet 222.222.22.22
without the second line of the eth-g1 inet
(ofcourse it is a fiktive ip)
I'm trying to output this in one line without \n
I have tried so far
ifconfig| egrep -o "eth-g0...|inet................"
but it is not so good because some times there is
inet 222.22.22.222
and sometimes
inet addr 22.222.22.22
and it prints me with new lines everything.