Click to See Complete Forum and Search --> : Links Question


WaveSurfer
07-08-2001, 06:00 AM
Im trying to get a program Mixmaster to run from the command line rather than going to the directory the executable is in and running it from there. I have some instructions but would like to clarify them before I go ahead. My instructions have told me to first mkdir /home/sam/bin which Ive done. Next they tell me to ln -s /home/sam/Mix/mix /home/sam/bin/mix now the problem is that in my case the executable is in the /home/sam/tmp/Mix-2.9beta23/Src directory Ive run the prog from there already. So with that in mind could someone confirm what I should do.
Thanks

Malakin
07-08-2001, 06:38 AM
I'll explain this a little for you.

When you try to run a program it first looks in the current directory and then it looks in the PATH. If you want to see what your current path is type this "echo $PATH" and it will spit out something like this "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin"
These are all the locations it searches.

Now if you have a program named "mix" and you want it to run from anywhere you have several options.

1. Move the program into a directory that is in the PATH.

2. Add the directory of your program to the PATH. If you want to change your path you can type this "PATH=$PATH:/home/sam/tmp/Mix-2.9beta23/Src/" "export PATH". NOTE: I don't suggest doing this.

3. Make a sym-link from a directory in the PATH to where your program is. So in this case you can type "ln /home/sam/tmp/Mix-2.0beta23/Src/mix /usr/bin/mix -s" and it will create a symbolic link to your mix program in the "/usr/bin" directory which is always in the PATH. Now this would work and it wouldn't be too bad but if you want to keep your system neat and tidy I suggest copying your program somewhere logical like "/home/sam/bin" as someone else suggested and then making a symlink there instead "ln /home/sam/bin/mix /usr/bin -s". If you do start putting your own programs in "/home/sam/bin/" then you might want to just add this to your PATH.

I hope there's no typos in all this, good luck :)

[ 08 July 2001: Message edited by: idealego ]

WaveSurfer
07-09-2001, 05:49 AM
Thanks for the detailed reply.
Many thanks !!