3 ms·
Sure, I'm saying that would be a fairer comparison - getting output from something that has no defined interface. So why not compare apples to apples, how woul
by taviso 6y ago
Sure, I'm saying that would be a fairer comparison - getting output from something that has no defined interface.
So why not compare apples to apples, how would powershell extract the MAC from ifconfig output? If that's more flexible or powerful than bash with standard UNIX tools, then that might be impressive!
- majkinetor 6y ago> how would powershell extract the MAC from ifconfig output? It could go identically crazy as in bash, as it has its own grep (sls), can use grep itself etc. > (ipconfig /all | sls Physical) -replace ".+: " 00-FF-84-14-66-D7 00-FF-B7-06-19-0F 00-15-5D-00-1F-3C ...
- taviso 6y agoRight, that's a fairer comparison. So the question is, why is that better?
- majkinetor 6y agoIts not. Everything else is. Although, on more thought, it is better even as parsing engine as you have system design rules enforced across tools and OSes. Even single tool may work differently depending on *nix flavor.
- 13of40 6y agoHere's what I got: ifconfig | ?{$_ -like "eth0 *"} | %{($_ -Split " ")[-1]} In other words, find the line that starts with "eth0 ", then return the last column using " " as a delimiter.