Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have recently installed on Mac OS X Lion 10.7.4 the GDAL Framework 1.9 with Python bindings from [http://www.kyngchaos.com/software:frameworks][1].

I need to add the following Programs folder to my ~/.bash_profile as described in the ReadMe file:

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH

This is what's currently on my ~/.bash_profile:

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

What is the right syntax for adding the new path?

I am new with everything (Mac, Python and GDAL) so please excuse me if I wasn't clear.

Many Thanks

Andrea

share|improve this question
add comment

1 Answer 1

This is a bit off-topic, but it's an easy fix. In the BASH shell, the colon character is used to separate paths in a list, and the ${PATH} evaluates to whatever the PATH environment variable was. So you can either add the GDAL path as a separate line:

PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}
PATH=/Library/Frameworks/GDAL.framework/Programs:${PATH}
export PATH

or put it all on one line:

PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/GDAL.framework/Programs:${PATH}
export PATH

It's entirely up to you: either way, you'll end up with the same path list.

share|improve this answer
1  
Or really put it all on one line: export PATH=... –  lynxlynxlynx Jun 11 '12 at 12:34
3  
And don't forget to quote the whole thing, since there's a slight chance the existing path may contain whitespace. –  lynxlynxlynx Jun 11 '12 at 12:35
    
Thanks, very helpful! –  aacinelli Jun 13 '12 at 21:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.