简体   繁体   中英

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. Since there is no file named /Users/vaibhavkumar/spark in any directory in your PATH variable, you get the observed error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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