diff options
author | 2015-09-18 12:00:12 +0200 | |
---|---|---|
committer | 2015-09-24 15:32:15 +0200 | |
commit | f24d5cb5f05b6edc313534e8ff39b8b6de446a7e (patch) | |
tree | 6cac935e46448e3766d7cb06e83a73cd7aa461e8 /share/functions/__fish_print_addresses.fish | |
parent | 79c22c76bffa7d0e5ced234150c7874c783bd72a (diff) |
__fish_print_{addresses,interaces}: Better OSX/BSD
Diffstat (limited to 'share/functions/__fish_print_addresses.fish')
-rw-r--r-- | share/functions/__fish_print_addresses.fish | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/share/functions/__fish_print_addresses.fish b/share/functions/__fish_print_addresses.fish index 578c9f63..fd8c6035 100644 --- a/share/functions/__fish_print_addresses.fish +++ b/share/functions/__fish_print_addresses.fish @@ -2,7 +2,10 @@ function __fish_print_addresses --description "Print a list of known network add if command -s ip >/dev/null command ip --oneline address | cut -d" " -f7 | sed "s:\(.*\)/.*:\1:" else if command -s ifconfig >/dev/null - command ifconfig |sgrep 'inet addr'|cut -d : -f 2|cut -d ' ' -f 1 + # This is for OSX/BSD + # There's also linux ifconfig but that has at least two different output formats + # is basically dead, and ip is installed on everything now + ifconfig | awk '/^\tinet/ { print $2 } ' end end |