diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2010-01-16 15:22:49 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2010-01-16 15:22:49 +0200 |
commit | 878c9dd5c9fa8cf195d1246d2611fc19d7604408 (patch) | |
tree | 8278bfce6e73f782553482aabeca6adcb4bf6710 | |
parent | 8d6570670ab79a4744470e3d331579f93f2c097a (diff) | |
download | bash-completion-878c9dd5c9fa8cf195d1246d2611fc19d7604408.tar.gz |
Fix finding known hosts files from SSH configs on systems with non-GNU sed.
There's no alternation functionality ('\|' or '|') in POSIX BRE.
-rw-r--r-- | bash_completion | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bash_completion b/bash_completion index 1ac5bf41..dea0b191 100644 --- a/bash_completion +++ b/bash_completion @@ -1288,7 +1288,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[@]}" | sort -u ) ) + tmpkh=( $( awk 'sub("^[[:space:]]*([Gg][Ll][Oo][Bb][Aa][Ll]|[Uu][Ss][Ee][Rr])[Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee][[:space:]]+", "") { print $0 }' "${config[@]}" | sort -u ) ) for i in "${tmpkh[@]}"; do # Remove possible quotes i=${i//\"} |