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

Re: Sourcing bash completion files



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



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