Created
April 16, 2013 16:13
-
-
Save horitaku1124/5397270 to your computer and use it in GitHub Desktop.
eth0のIPアドレスを表示
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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