- avoid double machine name bug in scp

This commit is contained in:
ianmacd 2002-10-05 05:52:37 +00:00
parent 98dee7dfa6
commit 0ce0956a81

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05b # bash_completion - some programmable completion functions for bash 2.05b
# #
# $Id: bash_completion,v 1.421 2002/10/02 03:32:40 ianmacd Exp $ # $Id: bash_completion,v 1.422 2002/10/05 07:52:37 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -1740,7 +1740,7 @@ _chkconfig()
} }
[ "$have" ] && complete -F _chkconfig chkconfig [ "$have" ] && complete -F _chkconfig chkconfig
# This function orovides simple user@host completion # This function provides simple user@host completion
# #
_user_at_host() { _user_at_host() {
local cur local cur
@ -1900,7 +1900,7 @@ _scp()
# default to home dir of specified user on remote host # default to home dir of specified user on remote host
path=$( ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) path=$( ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null)
fi fi
COMPREPLY=( $( compgen -P "$userhost:" \ COMPREPLY=( $( compgen \
-W "`echo $( ssh -o 'Batchmode yes' $userhost \ -W "`echo $( ssh -o 'Batchmode yes' $userhost \
compgen -f -- $path 2>/dev/null)`")) compgen -f -- $path 2>/dev/null)`"))
return 0 return 0