Created
January 6, 2018 00:55
-
-
Save rewida17/2d907712b52ec0a6599b7de8afb0de19 to your computer and use it in GitHub Desktop.
Get yours actuall IP addr on Iface
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 addr | grep -i "wls3" | tail -n1 |sed "s/inet//g" | sed "s/\/24/\\n/g" | head -n1 | |
#How it`s work | |
#Print info about network Iface ( print using \n not \f and only IPv4 address) | |
#ip -0 -4 addr|\ | |
#Get some info about specific Iface | |
#grep -i "wls3" |\ | |
#tail -n1 |\ | |
#remove "inet" | |
#sed "s/inet//g" |\ | |
#Replace internet mask by new line mark | |
#sed "s/\/24/\\n/g" |\ | |
#Print address | |
#head -n1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment