Nerdy Bunz
Nerdy Bunz

Reputation: 7417

How to make sure Homebrew path is set up properly on Mac

When I install brew on a MacOS (Ventura) using

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

... the very last part of the install script outputs:

Run these two commands in your terminal to add Homebrew to your PATH: (echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/pieface/.zprofile eval "$(/usr/local/bin/brew shellenv)"

However, there is no ".zprofile" file in my user directory. To my knowledge the file that contains my path configuration is .zshrc, a file which seems unmodified by the install script.

To further confuse matters, typing "which brew" immediately after the install script completes indicates that it is in my path (it works). But how can this be possible? And why would they suggest manually adding it to path using above instructions if it already works?

Would it be acceptable/equivalent to simply add

eval "$/usr/local/bin/brew shellenv" 

to my .zshrc file?

I am afraid to proceed for fear of borking my system.

I'm newish to linux/mac/bash stuff... some clarification would be appreciated.

Upvotes: 0

Views: 7960

Answers (1)

Gary Ox64
Gary Ox64

Reputation: 81

There is an introduction about zprofile and other config files, the >> will create a file if there isn't before.

And also a question about eval "$/usr/local/bin/brew shellenv"

Upvotes: 2

Related Questions