summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2013-02-01 19:39:03 +0200
committerVille Skyttä <ville.skytta@iki.fi>2013-02-01 19:43:21 +0200
commit87dede96c0fe8961081310284bfe58972dd801c4 (patch)
treef3cf45532676545e8af7ec5308e59391ea437af4
parentf6df76e8cac6ae47b93c87d594d70dab211b860a (diff)
downloadbash-completion-87dede96c0fe8961081310284bfe58972dd801c4.tar.gz
_mac_addresses: Try ARP cache with "ip neigh" if arp is not available.
-rw-r--r--bash_completion2
1 files changed, 1 insertions, 1 deletions
diff --git a/bash_completion b/bash_completion
index f559f9b4..869218fc 100644
--- a/bash_completion
+++ b/bash_completion
@@ -830,7 +830,7 @@ _mac_addresses()
) )
# ARP cache
- COMPREPLY+=( $( arp -an 2>/dev/null | sed -ne \
+ COMPREPLY+=( $( { arp -an || ip neigh show; } 2>/dev/null | sed -ne \
"s/.*[[:space:]]\($re\)[[:space:]].*/\1/p" -ne \
"s/.*[[:space:]]\($re\)[[:space:]]*$/\1/p" ) )