I will reference in the future. Good point. Sometimes too much information just muddies the water and I try to ask clear questions as much as possible. If I throw too much at someone they may run and hide.

As for the code eth0 has no IPv4 information in it, but does have IPv6, so that is why the data returns empty. Here is the output of ifconfig

eth0 Link encap:Ethernet HWaddr 00:19:B9:EB:80:91 inet6 addr: fe80::219:b9ff:xxxx:8091/64 Scope:Link 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) Interrupt:169 Memory:f4000000-f4011100 eth1 Link encap:Ethernet HWaddr xx:19:xx:xx:80:xx inet addr:xx.xx.xx.xx Bcast:xx.xx.xx.xx Mask:xx.xx.xx.xx inet6 addr: 3xxx:80c0:22c:225:219:b9ff:xxxx:80xx/64 Scope:Gl +obal inet6 addr: fexx::219:b9ff:feeb:80xx/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4173511549 errors:0 dropped:0 overruns:0 frame:0 TX packets:4181891776 errors:0 dropped:0 overruns:0 carrier: +0 collisions:0 txqueuelen:1000 RX bytes:696505594365 (648.6 GiB) TX bytes:630337964502 (58 +7.0 GiB) Interrupt:169 Memory:f8000000-f8011100 lo Link encap:Local Loopback inet addr:xx.xx.xx.xx Mask:xx.xx.xx.xx inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:4698160 errors:0 dropped:0 overruns:0 frame:0 TX packets:4698160 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:611857168 (583.5 MiB) TX bytes:611857168 (583.5 Mi +B)

I need this thing to not care about who has what. Not be dependant on IPv4 being satisifed. If IPv4 info is there print it. if IPv6 info is there print that too. Frustrated trying to figure that out.

yesterday I mistakenly said What is garanteed is v4 data. What is not garanteed is which NIC the v4 data will be on and if there will be any v6 data and now I am realizing some nic devices could have IPv4 only, IPv6 only, or both.
Can you or someone help me get that piece fixed?


In reply to Re^2: Need help with small IF statement by MikeDexter
in thread Need help with small IF statement by MikeDexter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.