diff --git a/contrib/bluez-utils b/contrib/bluez-utils index 4b35ff4e..f2223231 100644 --- a/contrib/bluez-utils +++ b/contrib/bluez-utils @@ -7,15 +7,15 @@ have hcitool && { _bluetooth_adresses() { if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then - COMPREPLY=( ${COMPREPLY[@]:-} $( hcitool scan | \ - awk '/^\t/{print $1}' | grep "^$cur" ) ) + COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool scan | \ + awk '/^\t/{print $1}' )" -- $cur ) ) fi } _bluetooth_devices() { - COMPREPLY=( ${COMPREPLY[@]:-} $( hcitool dev | \ - awk '/^\t/{print $1}' | grep "^$cur" ) ) + COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool dev | \ + awk '/^\t/{print $1}' )" -- $cur ) ) } _bluetooth_services()