Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac command line say "bad math expression: operand expected at end of string"

Tags:

macos

On macbook terminal, when i hit the command TAB key after ls. Terminal say error.

$ ls
_complete:96: bad math expression: operand expected at end of string

This example is ls, but other all command has same trouble. I rebooted mac but trouble has not cleared.

What's happen do you know?


Mac was shutdown by himself automatically, and repaired before i knew it.

OS is: OS X El Capitan.

like image 899
Yuma Inaura Avatar asked May 11 '16 06:05

Yuma Inaura


1 Answers

It's probably oh-my-zsh reporting insecure directory permissions.

Running compaudit in the terminal will show you those dirs. In my case it was:

/usr/local/share/zsh/
/usr/local/share/zsh/site-functions

I my case removing group write permissions like this:

chmod g-w /usr/local/share/zsh/
chmod g-w /usr/local/share/zsh/site-functions

helped.

Or do just:

compaudit | xargs chmod g-w

as my shell suggests. (MacOS 11.2.1)

Check also this answer.

like image 177
Picard Avatar answered Jan 02 '23 20:01

Picard