Capture output of a bash command, parse it and store into different bash variables

Capture output of a bash command, parse it and store into different bash
variables

pstrongExplanation:/strong/p pI have a small embash/em script which simply
runs emany/em Linux command (e.g. say codeifconfig/code)/p pThe typical
output of emifconfig/em is something like this:/p precodeeth0 Link
encap:Ethernet HWaddr 30:F7:0D:6D:34:CA inet addr:10.106.145.12
Bcast:10.106.145.255 Mask:255.255.255.0 inet6 addr:
fe80::32f7:dff:fe6d:34ca/64 Scope:Link UP BROADCAST RUNNING MULTICAST
MTU:1500 Metric:1 RX packets:1104666 errors:0 dropped:0 overruns:0 frame:0
TX packets:2171 errors:0 dropped:0 overruns:0 carrier:0 collisions:0
txqueuelen:1000 RX bytes:444437904 (423.8 MiB) TX bytes:238380 (232.7 KiB)
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.255.0.0 inet6
addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX
packets:15900 errors:0 dropped:0 overruns:0 frame:0 TX packets:15900
errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX
bytes:467306 (456.3 KiB) TX bytes:467306 (456.3 KiB) /code/pre pNow what
most people usually do is store the ementire/em output into a
file/variable and parse based on that. I however want to know if there is
anyway that I could put emspecific/em parts of the output in more than one
variable (say a embash variable/em called code${IPETH0}/code to carry the
IP address code10.106.145.12/code from emeth0/em and code${IPLO}/code to
carry the IP address code127.0.0.1/code from emlo/em in the above example
emwithout running ifconfig command twice/em)./p pSomething like what
emtee/em command does with the input but I want to do this for the
emoutput/em and store the output into 2 or emmore/em variables in one go.
Any ideas?/p