Fix macOS sed in SSH completion

See here for details: b5f666d467
pull/1481/head
Nils Winkler 2020-01-23 08:36:53 +01:00 committed by GitHub
parent e8b42c4687
commit d8d6109e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ _sshcomplete() {
for fl in "$HOME/.ssh/config" \
$(grep "^\s*Include" "$HOME/.ssh/config" |
awk '{for (i=2; i<=NF; i++) print $i}' |
sed -re "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|")
sed -Ee "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|")
do
if [ -r "$fl" ]; then
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$(grep -i ^Host "$fl" |grep -v '[*!]' | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) )