[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.0-99-g87dede9
Ville Skyttä
ville.skytta at iki.fi
Fri Feb 1 17:43:50 UTC 2013
The following commit has been merged in the master branch:
commit f6df76e8cac6ae47b93c87d594d70dab211b860a
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Fri Feb 1 19:35:55 2013 +0200
_mac_addresses: Fix with net-tools' ifconfig that outputs ether, not HWaddr.
diff --git a/bash_completion b/bash_completion
index 9412580..f559f9b 100644
--- a/bash_completion
+++ b/bash_completion
@@ -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
--
bash-completion
More information about the Bash-completion-commits
mailing list