mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 20:33:08 +00:00
parse *BSD interface names
This commit is contained in:
parent
db0ff0bcde
commit
440df37b41
1 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,11 @@ function __fish_print_interfaces --description "Print a list of known network in
|
||||||
set -l interfaces /sys/class/net/*
|
set -l interfaces /sys/class/net/*
|
||||||
string replace /sys/class/net/ '' $interfaces
|
string replace /sys/class/net/ '' $interfaces
|
||||||
else # OSX/BSD
|
else # OSX/BSD
|
||||||
command ifconfig -l | string split ' '
|
set -l os (uname)
|
||||||
|
if string match -e -q "BSD" -- $os
|
||||||
|
command ifconfig | string match -e -r '^[a-z]' | string replace -r ':.*' '' | string split ' '
|
||||||
|
else
|
||||||
|
command ifconfig -l | string split ' '
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue