1

I'm not a power user and recently installed Homebrew and Powershell on my MacBook running Ventura 13.1 to control my new T-Mobile Home Internet Gateway and since I get the following when running terminal:

/Users/ron/.zshrc:3: no such file or directory: /usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin# ➜ ~

Any help would be appreciated.

BTW: Powershell is working great.

➜  ~ cat ~/.zshrc

# Add Homebrew's executable directory to the front of the PATH
export PATH=/usr/local/bin:$PATH# If you come from bash you might have to change your 
$PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
    
# Path to your oh-my-zsh installation.
export ZSH="/Users/ron/.oh-my-zsh"
12
  • What is in your ~/.zshrc
    – mmmmmm
    Commented Jan 3, 2023 at 22:10
  • if I type ~/.zshrc – mmmmmm I get sh: permission denied: /Users/ron/.zshrc zsh: command not found: mmmmmm
    – Nora Velp
    Commented Jan 3, 2023 at 22:14
  • I meant what is in your ~/.zshrc ie output of cat ~/.zshrc
    – mmmmmm
    Commented Jan 3, 2023 at 22:17
  • I tried to paste the output of that command but got the following: Too long by 3229 characters
    – Nora Velp
    Commented Jan 3, 2023 at 22:23
  • I added the output of cat ~/.zshrc – mmmmmm here: docs.google.com/document/d/…
    – Nora Velp
    Commented Jan 3, 2023 at 22:49

1 Answer 1

2

My view on shell startup files is do not put anything in them that you do not understand so that you can debug them when they go wrong.

The issue here is that you have copied the file from somewhere and it has altered line endings. Probably by using an editor that wraps lines to a fixed side or that the original web site did not expand the text enough.

Your error is as the error says in line 3.

From the google doc (assuming that has not wrapped lines - please use plain text editors not word processors for scripts) line 3 is just

$PATH

This expands to the path and is not an executable. In this case it should be at the end on line 2 which is ended with a comment or more likely the comment should be line 3 including the $PATH as I think the comment refers to the next line.

My guess of the correct file

# Add Homebrew's executable directory to the front of the PATH
export PATH=/usr/local/bin:$PATH
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/Users/ron/.oh-my-zsh"

The 4th line which should be line 3 is the only one that does the change for Homebrew.

The rest is setup on-my-zsh and then the rest is comments so I would delete all that.

3
  • I give that a go once I figure how to make the edit.
    – Nora Velp
    Commented Jan 5, 2023 at 13:42
  • See apple.stackexchange.com/a/192658/237 but ~/.zshrc instead of ~/.bash_profile
    – mmmmmm
    Commented Jan 5, 2023 at 13:54
  • Thanks for all your help and guidance, I edited the file , tested and the error message is gone and powershell still works. I'm happy and greatfull to you mmmmmm and I'm sure glad I found this forum.
    – Nora Velp
    Commented Jan 5, 2023 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .