[Bash-completion-devel] _ip_addresses should be locale agnostic

Raphaël Droz raphael.droz+floss at gmail.com
Sun Dec 11 18:45:39 UTC 2011


In french address is spelled adresse.
$ /sbin/ifconfig|sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p'
is NULL, while
$ /sbin/ifconfig|sed -ne 's/.*adr:\([^[:space:]]*\).*/\1/p'
works

The attached patch addresses this by setting LANG=C

regards
-------------- next part --------------
diff --git a/bash_completion b/bash_completion
index 4335d7f..9b3ddd2 100644
--- a/bash_completion
+++ b/bash_completion
@@ -862,7 +862,7 @@ _configured_interfaces()
 _ip_addresses()
 {
     COMPREPLY+=( $( compgen -W \
-        "$( PATH="$PATH:/sbin" ifconfig -a |
+        "$( PATH="$PATH:/sbin" LANG=C ifconfig -a |
             sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
                 -ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
         -- "$cur" ) )


More information about the Bash-completion-devel mailing list