Skip to content

Commit

Permalink
_mac_addresses: Fix with net-tools' ifconfig that outputs ether, not …
Browse files Browse the repository at this point in the history
…HWaddr.
  • Loading branch information
scop committed Feb 1, 2013
1 parent cee32c6 commit f6df76e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,12 @@ _mac_addresses()
local re='\([A-Fa-f0-9]\{2\}:\)\{5\}[A-Fa-f0-9]\{2\}'
local PATH="$PATH:/sbin:/usr/sbin"

# Local interfaces (Linux: HWAddr, FreeBSD: ether)
# Local interfaces (Linux: HWaddr or ether, FreeBSD: ether)
COMPREPLY+=( $( ifconfig -a 2>/dev/null | sed -ne \
"s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]].*/\1/p" -ne \
"s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" -ne \
"s/^[[:space:]]\{1,\}ether[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" \
"s/.*[[:space:]]ether[[:space:]]\{1,\}\($re\)[[:space:]].*/\1/p" -ne \
"s/.*[[:space:]]ether[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p"
) )

# ARP cache
Expand Down

0 comments on commit f6df76e

Please sign in to comment.