zsh: permission denied: gam

断了今生、忘了曾经 提交于 2019-12-21 21:43:48

问题


I am using ZSH on macOS 10.12 with Oh My ZSH installed.

I recently installed GAM on my computer using the provided install script bash <(curl -s -S -L https://git.io/install-gam)

The script installs the command line tool gam to ~/bin/gam/gam, which is in my PATH.

However, when trying to execute any gam command in ZSH, I get the following:

➜  ~ gam info user
zsh: permission denied: gam

However, when executing the same (or any) command in bash, the tool works as expected.

I have been able to get the command to work by placing alias gam="~/bin/gam/gam" in my .zshrc, but this causes some unexpected issues with gam arguments beginning with ~.

~/bin/gam/gam has execute privileges as well as its accompanying folder ~/bin/gam/, so I can't figure out what's wrong here.


回答1:


~/bin/ was in my PATH but the subfolder ~/bin/gam/ was not. Calling gam would cause ZSH to find the folder ~/bin/gam/ and try to execute it, hence the permission denied error instead of command not found.

The reason gam worked in BASH was because the install script only added ~/bin/gam/ to my PATH in .bashrc and not .zshrc



来源:https://stackoverflow.com/questions/51073014/zsh-permission-denied-gam

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!