Skip to content

Instantly share code, notes, and snippets.

@horitaku1124
Created April 16, 2013 16:13
Show Gist options
  • Save horitaku1124/5397270 to your computer and use it in GitHub Desktop.
Save horitaku1124/5397270 to your computer and use it in GitHub Desktop.
eth0のIPアドレスを表示
#!/bin/bash
ip=`ifconfig eth0 | sed -n "s/ *inet addr:\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/g p"`
echo ${ip}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment