Use sed instead of grep, since grep -o isn't supported on OS X

darcs-hash:20051217221513-ac50b-1166a7d4814ee9e2cd960308fae4999431ebc3c1.gz
This commit is contained in:
axel 2005-12-18 08:15:13 +10:00
parent 00be44a69a
commit 891c2fc379
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ complete -c scp -d Hostname -a "
(
#Prepend any username specified in the completion to the hostname
echo (commandline -ct)|grep -o '.*@'
echo (commandline -ct)|sed -nre 's/(.*@).*/\1/p'
)(
cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1
):

View File

@ -71,7 +71,7 @@ complete -x -c ssh -d Hostname -a "
(
#Prepend any username specified in the completion to the hostname
echo (commandline -ct)|grep -o '.*@'
echo (commandline -ct)|sed -nre 's/(.*@).*/\1/p'
)(__fish_print_hostnames)
(__fish_print_users)@