Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list of ethernet adapters and mac addresses in Tcl

Status
Not open for further replies.

nick1313

Technical User
Jan 14, 2003
4
US
Dear group,

What is the command to get the available network adapters and their mac addresses on a computer using Tcl or any other package.

Thanks for your help.

Nick
 
There is none.
You use a system specific kludge.
There is no direct hardware interface to get this info.
You can grab it from a system utility using regexp.
Excuse the slop but the regexp here is too unwieldy for
this site.
Code:
set nicids [exec /sbin/ifconfig]
foreach line [split $nicids "\n"] {
            if {[regexp "HW.*(\[A-Z0-9\]+:\[A-Z0-9\]+:\[A-Z0-9\]+:\[A-Z0-9\]+:\[A-Z0-9\]+:\[A-Z0-9\]+)" $line all out]} {
               puts "$line, address = $out"
            }
          }

Don't know about windows, and don't care.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top