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"

nohillside
  • 100,768
  • What is in your ~/.zshrc – mmmmmm Jan 03 '23 at 22:10
  • if I type ~/.zshrc – mmmmmm I get sh: permission denied: /Users/ron/.zshrc zsh: command not found: mmmmmm – Nora Velp Jan 03 '23 at 22:14
  • I meant what is in your ~/.zshrc ie output of cat ~/.zshrc – mmmmmm Jan 03 '23 at 22:17
  • I tried to paste the output of that command but got the following: Too long by 3229 characters – Nora Velp Jan 03 '23 at 22:23
  • I added the output of cat ~/.zshrc – mmmmmm here: https://docs.google.com/document/d/12FXAtMxfgJAryuZP-8Rl-vXzHdMO1q63536wEU4Mf6s/edit?usp=sharing – Nora Velp Jan 03 '23 at 22:49
  • Just add the first 6 lines to the question – mmmmmm Jan 04 '23 at 09:52
  • ➜ ~ cat ~/.zshrc – mmmmmm

    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"

    – Nora Velp Jan 04 '23 at 13:30
  • Put that in the question and not in the comment especially as we need to see exactly how it is formatted – mmmmmm Jan 04 '23 at 13:43
  • To clarify one thing: "mmmmmm" is the username of the person who has been responding to you, it is not text that you should be including in your shell commands. – John Palmieri Jan 04 '23 at 19:46
  • Thanks for that clarification, I've added those lines above. – Nora Velp Jan 04 '23 at 19:51
  • You have an error message, you know the exact place where the error occurs, so what's the problem then? While you have posted part of your .zshrc, it is not entirely clear to me which is line 3. I would use a text editor to exactly see what line 3 is. If the answer by mmmmmm solves your case, please accept it (by clicking on the checkmark next to the answer). – user1934428 Jan 07 '23 at 11:27
  • I did not realize I needed to check off to accept the answer that solved the issue. Done – Nora Velp Jan 08 '23 at 12:34

1 Answers1

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.

mmmmmm
  • 30,160
  • I give that a go once I figure how to make the edit. – Nora Velp Jan 05 '23 at 13:42
  • See https://apple.stackexchange.com/a/192658/237 but ~/.zshrc instead of ~/.bash_profile – mmmmmm Jan 05 '23 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 Jan 05 '23 at 14:37