_known_hosts_real: Discard @markers at beginning of line.

This commit is contained in:
Ville Skyttä 2011-11-05 00:38:37 +02:00
parent 55ec6a079b
commit b54d3f022f
2 changed files with 5 additions and 3 deletions

View File

@ -1414,8 +1414,10 @@ _known_hosts_real()
if [ ${#kh[@]} -gt 0 ]; then
# FS needs to look for a comma separated list
COMPREPLY+=( $( awk 'BEGIN {FS=","}
/^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \
sub(" .*$", "", $i); \
/^\s*[^|\#]/ {
sub("^@[^ ]+ +", ""); \
sub(" .*$", ""); \
for (i=1; i<=2; ++i) { \
sub("^\\[", "", $i); sub("\\](:[0-9]+)?$", "", $i); \
if ($i ~ /'"$awkcur"'/) {print $i} \
}}' "${kh[@]}" 2>/dev/null ) )

View File

@ -3,7 +3,7 @@
doo
ike ssh-rsa qwerty1234/Qwerty+1234==
jub,10.0.0.1
kyl,100.0.0.2
@cert-authority kyl,100.0.0.2 xxxfoo
[10.10.0.3]:10022
[blah]:1234
fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555