Created
January 22, 2013 14:43
-
-
Save rajeevs1992/4595140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Author :Rajeev S | |
#Date :8/18/2011 2341hrs | |
#print mac id of a computer | |
import re | |
import os | |
os.system("clear") | |
ifconfigOutput=os.popen("ifconfig").read() | |
t='[a-z0-9]' | |
MACpattern=(t*2+':')*5+t*2 | |
m=re.search(MACpattern,ifconfigOutput) | |
print 'MAC address is ',m .group() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment