fish-shell/share/functions/__fish_print_interfaces.fish

9 lines
295 B
Fish
Raw Normal View History

function __fish_print_interfaces --description "Print a list of known network interfaces"
if test -d /sys/class/net
2017-01-19 01:50:43 +08:00
set -l interfaces /sys/class/net/*
string replace /sys/class/net/ '' $interfaces
else # OSX/BSD
command ifconfig -l | string split ' '
end
end