Originally posted by kman42:
Can you explain the "it's not a good idea to have a '.' in your path?"
It's a security issue. The $PATH variable contains trusted path with executables which get invoked by just typing their name. The paths are usually owned by root or by you so no one else can mess with the files in them.
The reason to put "." in your path is that you can just type "filename" instead of "./filename" to execute a binary in your current directory. But it will also search your current directory each time you (or a shell script which inherits your environment) issues a command like cp, ls, rm, ... .
Now the danger is that you could be in a directory where a different or even evil version of one of these commands is, put there by accident or the bad guy who just hacked your Mac, and then a simple "ls" typed while you are in that directory can do anything. So you should at least put the "." ath the end of your path.
But you could still accidently type "sl" instead of "ls" and it would execute any "sl" you have for whatever reason in your current directory instead of giving you an error message, and this "sl" could again do something you do not want, so the general advice is not to have your current directory in your path.
Of course if you like the convenience of typing "name" instead of "./name" for executables in the folder you are in, you are sure no evil jokers will put files in your public writeable directories, and you always know what you do you can have a "." in your path, but then I really would put it at the end.
I'm trying to get bioperl running, but it's installation isn't well documented on OSX. I'm using combination of manual installs, fink and CPAN. This is my first large-scale attempt at installing unix software so I am really cobbling things together from various instruction sets. Any info would be greatly appreciated.
thanks,
kman
I spent a few minutes reading on the bioperl site and also the linked page with the Mac OS X installation directions. Maybe the author was sometimes not too sure about what to do.
What I just noticed:
- Instead of typing "cd ~yourusername" you can simply type "cd ~" or just "cd".
- The .cshrc file will not get executed if there is a .tcshrc present, so check if you have a .tcshrc in your home directory and make your changes rather there. Important are only the two "setenv" lines (and the alias for your convenience), the path might already be okay even if it's not set there (see your current path with "echo $PATH")
- Putting Unix binaries into a directory like "/Applications/bioinf/ncbi/build" and then adding that directory to your $PATH isn't a good idea, you would end up with a too long path variable after a few such installations, a better place would be your personal ~/bin directory or system wide /usr/local/bin.
I wish you good luck
-