Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

echo $PATH doesn't match .bash_profile

I'm attempting to install homebrew on Mountain Lion so that I can install Ruby 1.9.3. After years of programming only PHP, 'm finally taking the jump into Rails, Git, etc. In anycase, I'm on a laptop that was given to me. Therefore, my login account is not the original account. I think that might be causing the problem I'm having.

When running brew doctor I get the following:

Warning: Homebrew's sbin was not found in your path. Consider amending your PATH variable so it contains: /usr/local/sbin

When running echo $PATH I get the following:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Users/chadimoglou/.rvm/bin

There is no .profile in my home directory. There is a .bash_profile. It looks like this

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session as a function

Any help for this terminal noob is much appreciated.

like image 931
Chadimoglou Avatar asked Jan 05 '13 19:01

Chadimoglou


People also ask

What is adding to PATH variable?

Adding a New Path in Bash We can add a new path to the PATH variable using the export command. To prepend a new path, such as /some/new/path, we reassign the PATH variable with our new path at the beginning of the existing PATH variable (represented by $PATH): export PATH=/some/new/path:$PATH.

What does$ PATH do in Linux?

This is a variable that can be configured to tell our Linux system where to look for certain programs. That way, when typing a command into the terminal, Linux checks the $PATH variable to see a list of directories to look for the program.

What is PATH variable in Bash?

In bash, the PATH variable is an important one. Any program that runs through the bash session inherits the variable, so it's important that PATH includes the necessary directories only. Adding more directory will only add redundancy to the system. To see all the environment variables for bash, run this command.

What is PATH variable in Unix?

The PATH environment variable is a colon-delimited list of directories that your shell searches through when you enter a command. Program files (executables) are kept in many different places on the Unix system. Your path tells the Unix shell where to look on the system when you request a particular program.


1 Answers

in your .bash_profile, you can simply do:

export PATH="$PATH:/usr/local/sbin"
like image 175
wless1 Avatar answered Sep 28 '22 07:09

wless1