Results 1 to 11 of 11
  1. #1


    Member Since
    May 12, 2010
    Posts
    5
    Setting my environmental PATH
    Hi guys,

    I'm trying to install a 'pre-compiled binary release' through terminal. Basically I am being told to move the files 'cufflinks' and 'cuffcompare' binaries in your PATH environment variable.

    So my question is what is the PATH environmental variable?

    And how do I move these files to that?

    I have looked elsewhere for the answer however I haven't found a suitable answer so far. Sorry for the newbie question.

    Thanks very much, JP

  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    It sounds like what you are being told is to add the path where cufflinks and cuffcompare are located to your PATH environment variable. This is done so that you can just type either of those names in the Terminal and the system can find them and execute them. Otherwise you have to type the full path to execute those executables.

    How you set the path is dependent on the shell being used. The default shell for OS X is now Bash. To add a path to the PATH environment variable is done like this;
    Code:
    export PATH=$PATH:/Users/Shared
    When you type a command that resides in that last path, you no longer have to type the whole path. Note also, that the shell searches through the paths in the order that they appear. This is important to know when you have two commands with the exact same name.

    Do a 'man bash' in the Terminal and look under the 'INVOCATION' section. You'll note that if you add your export command to one of three possible login shell files, that you will not have to type that command every time you start the shell.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  3. #3

    nabl's Avatar
    Member Since
    Dec 13, 2007
    Location
    United States of America
    Posts
    256
    Specs:
    2.1GHz MacBook with 4GB RAM, Mac OS X 10.6, iLife and iWork 09
    $PATH is a variable in the Terminal that tell the computer which directories contain programs; that is, when you type a command such as ls at the command-line, ls is the name of a program in one of the locations specified by $PATH.

    To figure out where a binary is, you can use the which command. For example, typing which ls should return something like /bin/ls, which means that if you were to navigate to the /bin directory, you'd see the ls program within.

    To see the list of locations that are currently set for $PATH, you can type echo $PATH at the command-line. It will return a list of directories (folders) separated by colons; these are the locations that will be checked in when you type a command name. In your case, you could copy those programs to a place like /usr/bin by typing the following command:
    Code:
    sudo cp program_name /usr/bin/
    You'll need to type in your administrator password for the command to work because /usr/bin is a system directory (you get permission to move files there with the sudo command). This will copy the program you choose to that folder, at which point you can simply type its name and press Return to run it.



    Alternatively, if you don't want to mess with using the sudo command (which you should always be extremely careful with), you can add a new directory to your $PATH, from which you'll be able to run commands in the future. To do this, you need to edit either .bashrc or .bash_profile. For example, type
    Code:
    open -a TextEdit ~/.bash_profile
    This will open your Bash profile (think of it as command-line preferences) in TextEdit, where you can add this line to the bottom:
    Code:
    export PATH=$PATH:/new/directory
    where /new/directory is the folder you want to add to your $PATH. For example, if you make a folder in your Home directory called Programs, you could run the command
    Code:
    export PATH=$PATH:/Users/your_username/Programs
    and any binaries you put in that folder will run when you type their names at the command prompt.

    Once you add that line to the file, save it and close it. For the change to take effect, type
    Code:
    source ~/.bash_profile
    This command tells the computer to look at .bash_profile and update any changes, which will in this case update your $PATH. To make sure it took effect, you can type echo $PATH again, and you should see the same list you saw before with your new location at the end. Then, when you add any programs to the folder you chose (in this example, /Users/your_username/Programs), you'll simply be able to type their name at the command prompt and press Return to run them.



    There's one final thing worth saying. If you only want to run a program once, you can navigate to the directory containing it and type the command name preceded by a period and a slash (./) to run the program regardless of whether the containing folder is in your $PATH or not. As an example, if your cuffs program is in your Downloads folder, typing the following two commands would run it a single time:
    Code:
    cd ~/Downloads
    ./cufflinks


    Hopefully that little overview will help you out. If you want to find out more, search for "bash path" on a search engine and you should get relevant results.

  4. #4


    Member Since
    May 12, 2010
    Posts
    5
    Thanks guys I managed to move the files prity successfully. Have got myself a UNIX book now aswell.

    I have another problem now though:

    I am trying to install another program it tells me to do this:

    "To install TopHat, unpack the tarball and change to the package directory as follows:

    tar zxvf tophat-1.0.7.tar.gz

    cd tophat-1.0.7/

    Now build the package:

    ./configure --prefix=/path/to/install/directory/

    make

    Finally, install TopHat:

    make install"

    I have tried to do this however it says there aren't the commands configure and make. I'm running bash on OS X Leopard on my Macbook Pro. Are 'make' and 'configure' not the commands used in bash?

    Thanks, James

  5. #5

    scathe's Avatar
    Member Since
    Jan 12, 2009
    Location
    Prague, Czech Republic
    Posts
    1,096
    Specs:
    2,4Ghz 15" unibody
    unless I'm mistaken, those commands come with the Mac OS Development kit

    Download Xcode - Apple Developer

    It can also be found on your Install Discs

  6. #6

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,741
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    scathe is correct. You will need to install the Xcode developer tools to get all the tools you need to build programs. As scathe mentioned, take a look at your install discs or download it from Apple's developer website.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  7. #7


    Member Since
    May 12, 2010
    Posts
    5
    Thanks guys, I have installed Xcode now and the 'make' cmd works. But it still doesn't recognise 'configure' as a command?

    J

  8. #8

    scathe's Avatar
    Member Since
    Jan 12, 2009
    Location
    Prague, Czech Republic
    Posts
    1,096
    Specs:
    2,4Ghz 15" unibody
    ok hold it, is there even a "configure" command? U sure it doesn't just refer to a file in the current directory with the name "configure"?

    maybe it's just a file that doesn't have execute permissions? to add the execute permission run:
    chmod +x filename
    in this case chmod +x ./configure

    first check if such file exists of course

  9. #9

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,741
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    scathe is again correct - configure isn't a command/program but is a file included with many programs distributed as source. You need to execute it as such: ./configure. The ./ at the beginning signifies that the command is going to be executed from the current directory.

    Note what you posted earlier:
    Quote Originally Posted by JayPea View Post
    ./configure --prefix=/path/to/install/directory/
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  10. #10


    Member Since
    May 12, 2010
    Posts
    5
    Thanks again scathe and vansmith. I did sort it out eventually. It was a file just a misplaced one, I did need the Xcode though.

    Thanks a lot!

    James

  11. #11

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,403
    Specs:
    13in macbook - 10.11 --- 21in. iMac 10.11 --- HP win 8
    Also, for some stuff to install correctly you might have to use :
    sudo make install
    so it can install in places where you don't usually have permission to put things.
    Depends on what you're installing and where it needs to go.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problems setting PATH variable in Lion
    By jon232 in forum OS X - Operating System
    Replies: 2
    Last Post: 10-28-2011, 01:52 AM
  2. "Use UNC path from Active Directory" not opening the entire path
    By jjw3579 in forum OS X - Operating System
    Replies: 1
    Last Post: 09-22-2011, 12:12 PM
  3. Setting the PATH
    By dewijones92 in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 05-04-2011, 07:27 PM
  4. setting path on OS
    By greisen in forum OS X - Apps and Games
    Replies: 0
    Last Post: 08-31-2009, 08:45 PM
  5. Environmental concerns
    By Nightblade in forum iPod Hardware and Accessories
    Replies: 16
    Last Post: 04-27-2005, 02:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •