10

For example, I want to follow this guide on how to disable Brew analytics (under warning) but I have no idea how to find my environmental variables.

Most of the guides out there I found, such as this one, are all outdated; ~/.bash_profile doesn't exist according to how the answer described it. Can some please explain to a new MacOS user how all this now works?

Please note my understanding of Unix-based filesystems are limited. Treat me as a noob.

Community
  • 1
  • 1
bli00
  • 2,215
  • 2
  • 19
  • 46

3 Answers3

9

You can create ~/.bash_profile. The easiest way to create it is to use the touch utility: touch .bash_profile . It is common to have a .profile which is read if bash can not find .bash_profile. You can get the documentation from a terminal with man bash. You can edit either of these files with any text type editor (not word processor).

Bill
  • 1,588
  • 12
  • 21
  • From the terminal, type `open .bash_profile` . This will typically open the file with textedit. – Bill Feb 19 '17 at 04:33
  • Under OS X, the .bash_profile is executed each time you open a terminal session, ie Terminal application, \Shell, \New Window. So in that sense it is permanent. I'm not aware of Apple deleting the file on an OS update. – Bill May 10 '17 at 02:54
  • Didn't work for me. It also doesn't look like a solution, but a workaround. You are exporting the environment variables every time that a terminal is opened just for that terminal. But if you have an application that depends on this variable it will not work. – Sertage Jan 10 '18 at 19:26
  • 1
    For the environment variables to take effect , you need to execute the file that you just modified. I use . .profile. The first period tells the system to execute your file, so don't overlook it. If you have a terminal window open already, you need to execute the same command in that terminal window. – Harry Mitchell Feb 05 '18 at 07:23
  • After adding `export PATH=:$PATH` to profile, you should run command `source ~/.bash_profile` to initialize the variable you just added, or open a new terminal instead. – the_prole Apr 16 '18 at 23:07
0

In case you're using zsh like me, you need to modify ~/.zshrc

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Rakesh Yembaram
  • 433
  • 4
  • 7
0

I Android Gradle project root I do

gradle app:assembleDebug --stacktrace

but I get error

Minimum supported Gradle version is 5.4.1. Current version is 5.1.

and message says

/gradle/wrapper/gradle-wrapper.properties to gradle-5.4.1-all.zip

but it is

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

so why is Gradle not building?

the_prole
  • 8,275
  • 16
  • 78
  • 163