As a result of command ifconfig in Linux I just want to keep the int addr and Mask in two strings:
eth0 Link encap:Ethernet HWaddr 22:33:0a:e9:15:76
inet addr:10.244.21.118 Bcast:10.244.21.127 Mask:255.244.255.192
inet6 addr: fe80::0050:aff:fee9:1576/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:807304 errors:0 dropped:0 overruns:0 frame:0
TX packets:611741 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:253087331 (241.3 MiB) TX bytes:167902811 (160.1 MiB)
to get finally this:
inet_addr: "10.244.21.118"
mask="255.244.255.192"
Is there any faster way? My only idea is parsing every line and then searching for int addr and deleting the name... but I don't know if it works out.