I am using zsh and like it very much, but work a lot with Android source which has compilation scripts that require bash to be evaluated correctly. These scripts need to be sourced prior to compilation and define environment variables and shell functions that are used during compilation.

Zsh cannot source these files, and if I try to issue emulate bash my shell becomes non-functionnal with plenty of these error every time I hit space (I am using oh-my-zsh, maybe that is a cause?):

url-quote-magic:24: bad pattern: ( ):/(|/localhost)/*

Is there a way for me not to switch to bash to evaluate these files, or to invoke a bash instance and import the new environments variables/functions it defined during sourcing into my zsh session? Or I am doomed to switch to bash every time I need to work on Android?

EDIT: found an answer to my own question. Sourcing a file using another shell does not seem to be possible, but in the case of Android macro files failing, this page brought a fix:


Basically, simply setting unsetopt nomatch will ask zsh to stop complaining about unmatched wildcards, which is enough to bring the scripts to completion. There will still be one error remaining, about the use of the complete bash internal command to add completion capabilities to one Android macro, but it is absolutely not critical here.

1 Answer 1


You could put your compilation commandline in a bash script, which sources the compilation scripts bevor executing the compilation command.

Something like

    . /path/to/environmentscript
    . /path/to/morefunctionsscript


Then instead of invoking compile_command by hand, you just invoke your new bash script.

  • That's a potential solution, but unfortunately the environment scripts take several seconds to complete and the compile command varies a lot. Therefore I cannot rely on this to work daily.
    – Gnurou
    Feb 8, 2012 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .