Skip to content

Instantly share code, notes, and snippets.

@etam
Last active August 2, 2016 10:34
Show Gist options
  • Select an option

  • Save etam/dc6145b60716c33754261ad0dcdd7462 to your computer and use it in GitHub Desktop.

Select an option

Save etam/dc6145b60716c33754261ad0dcdd7462 to your computer and use it in GitHub Desktop.
#!/bin/bash
A="$(ip addr show dev eth0)"
A="${A##*inet }"
echo "${A%%/*}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment