[MacPorts] #44558: bash-completion on ssh hostname adds bad function, causes syntax errors
MacPorts
noreply at macports.org
Wed Aug 6 10:33:30 PDT 2014
#44558: bash-completion on ssh hostname adds bad function, causes syntax errors
--------------------------------------+--------------------------------
Reporter: Daniel.Lipofsky@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.1
Keywords: bash-completion ssh _scp | Port: bash-completion
--------------------------------------+--------------------------------
Initially this works:
{{{
~$ /opt/local/bin/bash -c "/bin/echo foobar"
foobar
~$ /bin/bash -c "/bin/echo foobar"
foobar
~$ /bin/sh -c "/bin/echo foobar"
foobar
}}}
then I use ssh and I hit TAB to autocomplete the host name:
{{{
~$ ssh foo.example.com
...
[me at foo ~]$ exit
logout
Connection to foo.example.com closed.
}}}
There when I run the same tests again I get an error
{{{
~$ /opt/local/bin/bash -c "/bin/echo foobar"
/opt/local/bin/bash: _scp: line 28: syntax error near unexpected token `('
/opt/local/bin/bash: _scp: line 28: ` !(*:*)/* | [.~]*)'
/opt/local/bin/bash: error importing function definition for `_scp'
foobar
~$ /bin/bash -c "/bin/echo foobar"
/bin/bash: _scp: line 28: syntax error near unexpected token `('
/bin/bash: _scp: line 28: ` !(*:*)/* | [.~]*)'
/bin/bash: error importing function definition for `_scp'
foobar
~$ /bin/sh -c "/bin/echo foobar"
/bin/sh: _scp: line 28: syntax error near unexpected token `('
/bin/sh: _scp: line 28: ` !(*:*)/* | [.~]*)'
/bin/sh: error importing function definition for `_scp'
foobar
}}}
Removing the function definition clears the error
{{{
~$ unset -f _scp
~$ /opt/local/bin/bash -c "/bin/echo foobar"
foobar
~$ /bin/bash -c "/bin/echo foobar"
foobar
~$ /bin/sh -c "/bin/echo foobar"
foobar
}}}
additional info
{{{
~$ uname -srvpoi
Darwin 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014;
root:xnu-2422.110.17~1/RELEASE_X86_64 i386 MacBookPro8,2 Darwin
~$ type -all bash; echo $BASH_VERSION; bash -version | grep
version.*release
bash is /opt/local/bin/bash
bash is /bin/bash
4.3.18(1)-release
GNU bash, version 4.3.18(1)-release (x86_64-apple-darwin13.2.0)
~$ port installed | grep -iE 'bash|complet|ssh|ssl'
bash @4.3.18_0 (active)
bash-completion @2.1_8 (active)
curl @7.37.1_0+ssl (active)
openssl @1.0.1h_0 (active)
p5.16-io-socket-ssl @1.981.0_0 (active)
p5.16-net-smtp-ssl @1.10.0_0 (active)
p5.16-net-ssleay @1.580.0_0 (active)
wget @1.15_1+ssl (active)
wireshark
@1.10.7_2+adns+geoip+gnutls+ipv6+libgcrypt+libsmi+lua+rtp+ssl+x11 (active)
}}}
--
Ticket URL: <https://trac.macports.org/ticket/44558>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list