?
Solved

Changing $PATH variable - OS X

Posted on 2016-08-25
2
Medium Priority
?
99 Views
Last Modified: 2016-08-26
I am trying to update my $Path variable.  However, I am getting the message the executable needs to be in the PATH.

I used this command to update the path
echo 'export PATH=/Users/rjw/Documents/Python' >>~/.bash_profile

Open in new window


But when you look at echo $PATH you get the following without my path above.

export PATH=${PATH}:~/android-sdk-mac/tools
export PS1="rjw "
export PATH="/usr/local/mysql/bin:$PATH"
alias ll='ls -lahG'
export PATH=/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/rjw/android-sdk-mac/tools:/usr/local/mysql/bin

export PATH=/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/rjw/android-sdk-mac/tools:/usr/local/mysql/bin:/usr/local/mysql/bin

export PATH=/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/rjw/android-sdk-mac/tools:/usr/local/mysql/bin:/usr/local/mysql/bin

##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-01-13_at_10:05:16
##

# MacPorts Installer addition on 2016-01-13_at_10:05:16: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-07-26_at_16:54:01
##

# MacPorts Installer addition on 2016-07-26_at_16:54:01: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-07-26_at_17:07:46
##

# MacPorts Installer addition on 2016-07-26_at_17:07:46: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-07-26_at_17:13:45
##

# MacPorts Installer addition on 2016-07-26_at_17:13:45: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH

Open in new window


I uninstalled macports if that is the problem and went to homebrew instead.
0
Comment
Question by:sharingsunshine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 30

Accepted Solution

by:
serialband earned 2000 total points
ID: 41771165
This is more of a linux and bash question than just OS X.

After you ran your command, did you open a new Terminal window?  Did you reload your Terminal.  You current window won't load the .bash_profile until you've done something to reload it.

You can load it without restarting your terminal with the built-in source command:
source .bash_profile

You can start a new bash instance
bash

or if you want to reload your single instance,
exec bash


Your path command is also wrong.  You will replace all paths with just your home folder.
You really need
echo 'export PATH=$PATH:/Users/rjw/Documents/Python' >>~/.bash_profile

It also looks like macports added it's own path after yours, so the 2nd PATH setting won.

What are the current contents of your .bash_profile?
0
 

Author Comment

by:sharingsunshine
ID: 41771862
that's what I needed.  The path is in and working.  Thanks for the help.

I had closed the terminal window and then restarted it but that didn't do it.  But using  source .bash_profile and changing to your path made it work.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question