diff --git a/share/functions/__fish_print_addresses.fish b/share/functions/__fish_print_addresses.fish index 356c8559c..1bb6cd7a7 100644 --- a/share/functions/__fish_print_addresses.fish +++ b/share/functions/__fish_print_addresses.fish @@ -1,6 +1,6 @@ function __fish_print_addresses --description "Print a list of known network addresses" if command -sq ip - command ip --oneline address | cut -d" " -f7 | sed "s:\(.*\)/.*:\1:" + command ip --oneline address | string replace -r '(\S+\s+){3}(.+)/.*' '$2' else if command -sq ifconfig # This is for OSX/BSD # There's also linux ifconfig but that has at least two different output formats