Script in execution PATH

Discussion in 'Mac Programming' started by tirwit, Feb 2, 2010.

  1. tirwit macrumors newbie

    Joined:
    Jan 20, 2010
    #1
    Hi!

    I'm kinda new to this part of informatics so my question will look dumb... My apologies in advance.

    I need to work with a chart of nuclides which I found in http://www.yoix.org/sw/tools/yoix/elements.html

    I downloaded the Yoix Installer which supposedly brings the application (the link is on that webpage too). But in the bottom of the page you find this:

    But how do I do that? I mean... What's the PATH and what (and how do I do it?) is adding the script to it?

    I'm still undergraduate engineering physics student, so informatics it's not my strong point :confused:

    Thanks :)
     
  2. GroovyLinuxGuy macrumors regular

    GroovyLinuxGuy

    Joined:
    Apr 2, 2006
    Location:
    Canada
    #2
    You can run the script from wherever it is located (I will assume it is just in your home directory) by adding a ./ in front of it as in:
    ./ychart_elements

    To actually add it to your $PATH you can do the following
    export PATH=/location/of/script/directory:$PATH

    This will add it temporarily to your $PATH. If you edit the .bash_profile file hidden in your directory and add that line there it will become permanent. You can just add it at the bottom of the file.

    Another easy way to do this is just create a folder called "bin" (without the quotes) in your home directory, then put the script in there and I believe that OSX automatically adds it to your path once you log out and log back in again.

    If it doesn't seem to be working after you do any of the above, you may have to set the script to be executable. To do this from the terminal just type:
    chmod +x ychart_elements

    Some scripts are not set as executable when you download them.

    Here is a link to an article about setting your $PATH:
    http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/



    Cheers
     
  3. tirwit thread starter macrumors newbie

    Joined:
    Jan 20, 2010

Share This Page