[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 487088e1d215a10351ecde1ce13cd9cab0b5b221

Ville Skyttä ville.skytta at iki.fi
Thu Nov 26 21:52:30 UTC 2009


The following commit has been merged in the master branch:
commit 487088e1d215a10351ecde1ce13cd9cab0b5b221
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Thu Nov 26 23:46:36 2009 +0200

    Weed out duplicate known hosts files to check.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=541423#c4

diff --git a/bash_completion b/bash_completion
index e3b782c..2b528af 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1256,6 +1256,7 @@ _known_hosts_real()
         config=( "${config[@]}" "${HOME}/.ssh2/config" )
     fi
 
+    # Known hosts files from configs
     if [ ${#config[@]} -gt 0 ]; then
         local OIFS=$IFS IFS=$'\n'
         local -a tmpkh
@@ -1263,7 +1264,7 @@ _known_hosts_real()
         # TODO(?): try to make known hosts files with more than one consecutive
         #          spaces in their name work (watch out for ~ expansion
         #          breakage! Alioth#311595)
-        tmpkh=( $( sed -ne 's/^[ \t]*\([Gg][Ll][Oo][Bb][Aa][Ll]\|[Uu][Ss][Ee][Rr]\)[Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\2/p' "${config[@]}" ) )
+        tmpkh=( $( sed -ne 's/^[ \t]*\([Gg][Ll][Oo][Bb][Aa][Ll]\|[Uu][Ss][Ee][Rr]\)[Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\2/p' "${config[@]}" | sort -u ) )
         for i in "${tmpkh[@]//\"/}"; do
             i=$( eval echo "$i" ) # expand ~
             [ -r "$i" ] && kh=( "${kh[@]}" "$i" )

-- 
bash-completion



More information about the Bash-completion-commits mailing list