Ohmyzsh: awk: invalid -v option [OS X Lion]

Created on 30 Sep 2011  ·  19Comments  ·  Source: ohmyzsh/ohmyzsh

When attempting to auto-complete "./manage runserver" in a Django Project root folder, an awk error pops up:

(venv)➜ project git:(master) ./manage.py runs➜awk: invalid -v option

erver

Although it manages to complete the option, it seems awk does not support the -v flag on OS X Lion.

Most helpful comment

+1, why not put a space after "-v"? see there => http://www.zsh.org/mla/workers/2013/msg00023.html
Ok with macports gawk though

All 19 comments

Will this be fixed? Is there any work-around?

+1 I'm having the same issue.

I have the same issue with various other tools (for instance svn)

+1, the same issue :(

This bug is fixed in the sorin's fork. When they merge for 2.0, all be right again

Still having this issue.

+1 - please fix this, it's very annoying.

+1 here. Any workahound?

+1 here -- please fix

Try using gawk will solve the issue

brew install gawk
brew install gawk

That worked, thank you.

Same as @kemist, fixed the issue

+1, why not put a space after "-v"? see there => http://www.zsh.org/mla/workers/2013/msg00023.html
Ok with macports gawk though

@lajarre I installed gawk with brew but that didn't help. I also can't find the line in plugings/django/django.plugin.zsh
Could you tell me in what file should I add the space, please?

Thanks @humiaozuzu. @dschien I had to symlink awk to gawk. It probably didn't work for you because /usr/bin/awk is in your path before /usr/local/bin/gawk.

As @jcelliott I needed to symlink awk to gawk and now it works.

I found the 'awk -vdrop' in /usr/share/zsh/5.0.2/functions/_django 62 line, therefore I modified it to 'awk -v drop' and reloaded zsh. Now the autocompletion is good.

Had the same issues, fixed using gawk ... I also tried version 5.0.5 of zsh via brew and it is still in there.

Although it appears the issue was patched back in Jan of 2013: https://github.com/zsh-users/zsh/commit/0969fb91fa3dcf461a52f8dbda5313475c39f603

Thank you @thornomad for going the extra mile and checking the homebrew installation and the zsh repo :sparkles:

You should try zsh 5.0.6, it's definitely solved there (though in 5.0.5 it was too), and it should also be available via brew

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cabbagec picture Cabbagec  ·  3Comments

jaredmoody picture jaredmoody  ·  3Comments

oskargicast picture oskargicast  ·  3Comments

faxotherapy picture faxotherapy  ·  3Comments

cbou picture cbou  ·  3Comments