English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

I can't provide the exact code, because I don't have a solaris machine to check the exact format, but I would use the output of ifconfig, and pull out the piece you need.

On my Linux machine, I believe this would work. Note there is probably a cleaner or more correct way to do it, but I'm not a shell programmer.

set - `/sbin/ifconfig eth0 | head -1`
$MAC=$5

In the above, eth0 is the name of the interface, and $5 refers to
the 5th "field" on the line, which happens to be the MAC address in my case.

2006-09-19 06:59:39 · answer #1 · answered by Ken H 4 · 0 0

i'm guessing it is homework? :P somebody will in all probability supply you the respond yet what i will say is merely take a seat and calculate it out with the example you gave. Do it on a sheet of paper, then use that sheet of paper to create your code.

2016-12-12 11:10:18 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers