Skip to content

Instantly share code, notes, and snippets.

@diabloneo
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diabloneo/ec1b11d73c7a8e260058 to your computer and use it in GitHub Desktop.
Save diabloneo/ec1b11d73c7a8e260058 to your computer and use it in GitHub Desktop.
Command line Python to exchange MAC address bytes.
#!/bin/bash
mac="56:66:6c:03:ef:dc"
newmac=$(python -c "mac = \"${mac}\"; newmac=mac[0] + mac[16] + mac[2:]; print newmac")
echo ${newmac}
@diabloneo
Copy link
Author

I think it's more convenient than using shell's array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment