correct way to add path to ubuntu 14.04.3
2
0
Entering edit mode
8.6 years ago
bioguy24 ▴ 230

Is there a preferred way to add path to system. I recently had to re-install because of this and would like to avoid it in the future. Thank you :)

export PATH=/home/cmccabe/Desktop/NGS/samtools-1.2:$PATH
export PATH=$PATH:/home/cmccabe/Desktop/NGS/samtools-1.2
ngs • 1.9k views
ADD COMMENT
0
Entering edit mode

You do not need to re-install if you borked your PATH. Next time instead of re-installing, use the install DVD to fix the broken system.

ADD REPLY
2
Entering edit mode
8.6 years ago

this is not really a bioinformatics question but all of us running tools need to know this - so we should really answer this as bioinformatics rather than punting to Stack Overflow ... the difference between the two is where do you want the system to find a tool if it were listed twice?

  • do you want the new path to supersede the old? use the first version
  • do you want the system to possibly find another version in a previous directory of the path and then as last resort look in the directory you've listed: use the second version

Typically we use the first version because that is the intended usage.

ADD COMMENT
3
Entering edit mode
8.6 years ago

In general it makes more sense to prepend the PATH, since the directories are searched in order (so if you had previously added /home/cmccabe/Desktop/NGS/samtools-1.1 and typed "samtools" you wouldn't still get version 1.1).

BTW, this isn't a bioinformatics question.

Edit: If you happen to be using shared servers, ask the admin to install "environment modules". I set these up on our own cluster so everyone can "module load samtools/1.1" or "module load samtools/1.2" and have the PATH set nicely. This makes it convenient to always get the right version without needing to manually muck with the PATH all the time.

ADD COMMENT
0
Entering edit mode

my thoughts exactly ;-)

ADD REPLY
0
Entering edit mode

I blame the transatlantic packet lag for your faster response :P

ADD REPLY
0
Entering edit mode

Thank you both and I apologize for the mispost, but appreciate your help. Thank you :).

ADD REPLY

Login before adding your answer.

Traffic: 1358 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6