diff options
-rw-r--r-- | bash_completion | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bash_completion b/bash_completion index 02527690..c5cd7c95 100644 --- a/bash_completion +++ b/bash_completion @@ -793,9 +793,11 @@ _mac_addresses() local re='\([A-Fa-f0-9]\{2\}:\)\{5\}[A-Fa-f0-9]\{2\}' local PATH="$PATH:/sbin:/usr/sbin" - # Local interfaces (Linux only?) + # Local interfaces (Linux: HWAddr, FreeBSD: ether) COMPREPLY+=( $( ifconfig -a 2>/dev/null | sed -ne \ - "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" ) ) + "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" -ne \ + "s/^[[:space:]]\{1,\}ether[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" \ + ) ) # ARP cache COMPREPLY+=( $( arp -an 2>/dev/null | sed -ne \ |