image
image
Ticket Options
Question Details
TICKET ARCHIVE -> Unix Binaries
twisted - Aug 4, 2005 - 3:31 pm
image
image
Im kinda new to the world of unix commands and stuff, or rather not new but a novice. My question is, is there a way I can install a binary or a directory I can put the binary in so that i do not have to write its full path name every time to execute. Before I got my powerbook, and was using an imac with 10.1, I was able to do this with an ogmdemux binary (I dont know how), but now I cannot. The only reason I ask this, is so that it is easier to organize all the binaries and I wont have to remember where they are all located or do a search for them each time. Thanks for the help.
kethraal - Aug 4, 2005 - 11:28 pm
image
image
Hi Anand,

Traditionally binaries are installed in '/usr/bin', '/usr/local/bin', or even '/opt/bin'. Since those locations require root access to write to, it's probably not a good idea to tamper around with them... MacOS X uses that directory, and if you accidentally change something it needs, you can wind up with a very dead system. Instead, you can create a new folder in your home directory for the binaries. Here's what we're gonna do:

1) Open the Terminal.

2) Type "mkdir ~/bin" This will make a new directory called 'bin' within your home directory... this is where we're going to put our binaries. (You can actually name it whatever you want, 'bin' is just a unix convention.

3) Now we're gonna tell the Mac where to look for the binaries. Type the following command "pico ~/.profile" This will create a new (hidden) file that is used by the command shell.

4) You may have noticed that when you entered that last command, a very un-mac-like screen came up. "UW PICO" should be in the top right-hand corner of the 'Terminal' screen. This is pico, a unix text editor. Type the following text into pico "export PATH=$PATH:~/bin" . This should be all on one line, and the only line in the file.

5) Press 'Ctrl + o' The screen should change slightly to display the text "File Name to write : .profile" about 7/8 of the way down the window. At this prompt, press enter to save the file with that name.

6) Now press "Ctrl + x". You should be looking at the command line again.

7) Quite 'Terminal'.

Now when you re-launch 'Terminal', the Mac will know to look in the "bin" directory of your home folder for any binaries that you may place there.

NOTE: In MacOS X, items that begin with a period are not visible in the Finder. Therefore, you may want to replace "bin" in this example with ".bin" If you name your binaries folder that, you won't run the risk of accidentally trashing them in the Finder. While the "ls" command will not work, to see a folder hidden in this manner, you can simply type "ls -a" in the terminal.

If you need any more detail regarding this process, or if it doesn't work, please don't hesitate to let me know.

Good luck,
--------
Rob, MacOSX.com Tech.
kethraal - Aug 7, 2005 - 12:58 pm
image
image
Hi Anand,

If the procedure worked, and your problem is solved, please tell me so that I can close out this ticket.

Thanks,
--------
Rob, MacOSX.com Tech.
twisted - Aug 11, 2005 - 2:18 pm
image
image
Yeah, everything seemed to work fine, thanks for all the help, and sorry for responding so late.
kethraal - Aug 11, 2005 - 10:41 pm
image
image
Hi Anand,

No problem at all. Thanks for using MacOSX.com

All the best,
--------
Rob, MacOSX.com Tech.
Helpful? Let me know... give feedback!

IF THIS IS YOUR QUESTION AND YOU WISH TO RESPOND, LOGIN HERE FIRST.


Search Engine Friendly URLs by vBSEO 3.1.0