[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: mac adrress
 
- From: steve donovan <steve.j.donovan@...>
 
- Date: Thu, 18 Mar 2010 14:46:40 +0200
 
On Thu, Mar 18, 2010 at 2:38 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> So, use io.popen instead.
>
f = io.popen('ipconfig /all')
line = f:read()
while line do
  if line:find 'Ethernet adapter Local Area Connection' then
    line = f:read()
    while not line:find 'Physical Address' do line = f:read() end
    print(line:match(': (.+)'))
    return
  end
  line = f:read()
end
The only semi-clever bit is the string match that returns everything
after the colon on the Physical Address line