Skip to content

Instantly share code, notes, and snippets.

@johncarroll
Created July 24, 2015 13:17
Show Gist options
  • Save johncarroll/d19d5aebe748581df1ed to your computer and use it in GitHub Desktop.
Save johncarroll/d19d5aebe748581df1ed to your computer and use it in GitHub Desktop.
Generate id number from IP address octets
ID=hostname -I | awk -F '.' '{ print ($3*255+$4) }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment