Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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()
Advertisement
Add Comment
Please, Sign In to add comment