New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Setting my environmental PATH


Post Reply New Thread Subscribe

 
Thread Tools
JayPea

 
Member Since: May 12, 2010
Posts: 5
JayPea is on a distinguished road

JayPea is offline
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
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
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.
QUOTE Thanks
nabl

 
nabl's Avatar
 
Member Since: Dec 13, 2007
Location: United States of America
Posts: 256
nabl has a spectacular aura about
Mac Specs: 2.1GHz MacBook with 4GB RAM, Mac OS X 10.6, iLife and iWork 09

nabl is offline
$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.
QUOTE Thanks
JayPea

 
Member Since: May 12, 2010
Posts: 5
JayPea is on a distinguished road

JayPea is offline
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
QUOTE Thanks
scathe

 
scathe's Avatar
 
Member Since: Jan 12, 2009
Location: Prague, Czech Republic
Posts: 1,096
scathe is a jewel in the roughscathe is a jewel in the rough
Mac Specs: 2,4Ghz 15" unibody

scathe is offline
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
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Ottawa
Posts: 17,149
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Mac-Forums Investigates MacKeeper - Confused about MacKeeper? Take a look at this review.
QUOTE Thanks
JayPea

 
Member Since: May 12, 2010
Posts: 5
JayPea is on a distinguished road

JayPea is offline
Thanks guys, I have installed Xcode now and the 'make' cmd works. But it still doesn't recognise 'configure' as a command?

J
QUOTE Thanks
scathe

 
scathe's Avatar
 
Member Since: Jan 12, 2009
Location: Prague, Czech Republic
Posts: 1,096
scathe is a jewel in the roughscathe is a jewel in the rough
Mac Specs: 2,4Ghz 15" unibody

scathe is offline
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
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Ottawa
Posts: 17,149
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Mac-Forums Investigates MacKeeper - Confused about MacKeeper? Take a look at this review.
QUOTE Thanks
JayPea

 
Member Since: May 12, 2010
Posts: 5
JayPea is on a distinguished road

JayPea is offline
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
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 2,633
cradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud of
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« Why use delegates? | Help me to use "CGContextClipToMask" »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
setting path on OS greisen OS X - Apps and Games 0 08-31-2009 07:45 PM
Network path to windows machine on network jdmcm Internet, Networking, and Wireless 0 11-12-2008 01:43 PM
File path "Save As" Dialog box curiouslearn Switcher Hangout 2 10-09-2008 09:22 PM
Full path is not showing up correctly in address bar mac_min Web Design and Hosting 0 02-28-2008 11:23 AM
how can i set the path? Bo Eddy OS X - Development and Darwin 1 05-12-2004 10:45 AM

All times are GMT -4. The time now is 03:58 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?