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
Solved

Changing $PATH variable - OS X

Posted on 2016-08-25
2
74 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
2 Comments
 
LVL 29

Accepted Solution

by:
serialband earned 500 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
shell script 2 36
Mac Os Sierra Safari Tabs 12 64
Excel for Mac - How make those Tabs larger? 2 47
has anyone used Parallels Desktop 12 for Mac? is it working? 14 88
Deploystudio is a system which can be used to deploy OSX clients and servers within the small/medium or large business environments. The system is built ontop of the OSX Server NetBoot system and uses images & workflows as its core assets. Although …
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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