Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Sourcing bash completion files



On Thu Dec 31 03:17:54 2015, Eric Cook wrote:
> On 12/30/2015 08:36 PM, Bart Schaefer wrote:
> > On Dec 31, 12:22am, Alarig Le Lay wrote:
> > }
> > } source /usr/share/bash-completion/bash_completion
> > } 
> > } But I have an error on the source line:
> > } /usr/share/bash-completion/bash_completion:35: parse error near `]]'
> > 
> > Interesting, it appears bash has adopted the ksh-style @(...) grouping
> > syntax.  (Chet will probably confirm or deny.)
> > 
> > Try:
> > 
> > emulate sh -o kshglob -c 'source /usr/share/bash-completion/bash_completion'
> > 
> that error is due to [[ not being able to span across lines.
> ignoring that, unfortunately that file has a quite a few bashism that just won't work in zsh.
> an incomplete list:
>  - printf having a -v option (saves the output to a parameter).
>  - relying on parameters like BASH_SOURCE, FUNCNAME
>  - use of the bash builtins shopt, compopt and bind
>  - bash's typeset -F option prints function names where as zsh's typeset -F sets the floating point attribute

It seems to not work.
Regarding to your advices, I put those lines:
emulate sh -o kshglob -c 'source /usr/share/bash-completion/bash_completion' 2>/dev/null
emulate sh -o kshglob -c 'source /usr/share/bash-completion/completions/ping6'

But when I try to complete from ping6 I have an error “command not
found: _init_completion”

-- 
Alarig Le Lay

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author