ifconfigvar=$(ifconfig eth0) && echo $ifconfigvar
You can see that output of the above command has no formatting:
eth0 Link encap:Ethernet HWaddr 00:1f:16:ef:5b:c0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)