简体   繁体   English

无法在 zsh 配置文件中添加路径,显示未找到的有效目录已在 bash 和 zsh 中尝试过

[英]Not able to add path in zsh profile, valid directory showing not found have tried in both bash and zsh

nikitapant@IND-FVFXL93UHV29 ~ % ls
Applications        Library         Postman Agent
DataGripProjects    Movies          Public
Desktop         Music           Result_33.csv
Documents       Pictures        spark
Downloads       Postman
nikitapant@IND-FVFXL93UHV29 ~ % pwd
/Users/vaibhavkumar
nikitapant@IND-FVFXL93UHV29 ~ % echo $PATH
/Users/vaibhavkumar:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
nikitapant@IND-FVFXL93UHV29 ~ % source ~/.zshrc
/Users/vaibhavkumar/.zshrc:5: /Users/vaibhavkumar/spark not found
nikitapant@IND-FVFXL93UHV29 ~ % vi ~/.zshrc
nikitapant@IND-FVFXL93UHV29 ~ % 

As this folder is available at the specified location but showing not found, not able to find any clue.由于此文件夹在指定位置可用但显示未找到,无法找到任何线索。

PNG

You need to get rid of the $ .你需要摆脱$

export SPARK_HOME=/Users/vaibhavkumar/spark

With the dollar sign, the undefined parameter first expands to the empty string, leaving you with使用美元符号,未定义的参数首先扩展为空字符串,留下

export =/Users/vaibhavkumar/spark

A word prefixed with = in zsh tries to do path lookup on that word. zsh中以=为前缀的词会尝试对该词进行路径查找。 Since there is no file named /Users/vaibhavkumar/spark in any directory in your PATH variable, you get the observed error.由于在PATH变量的任何目录中都没有名为/Users/vaibhavkumar/spark的文件,因此您会看到观察到的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM