LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-08-2012, 12:59 AM   #1
djmb
LQ Newbie
 
Registered: Feb 2011
Location: Paris
Distribution: Debian Wheezy amd64 xfce desktop
Posts: 23

Rep: Reputation: 0
how to change PATH in Debian squeeze


Dear all,

I am trying to change my PATH. I recently added a prg to a directory; this prg is a newer version of another prg and I have to install both to get things running. But as I want the newer prg to be tried first (texlive, it's packaged based), I need to add its directory before other directories.

So I added the following at the top of the ~/.bashrc file:
PATH=$PATH:/home/me/newdir
export PATH

then I did
source ~/.bashrc

then:
echo $PATH

and I got:
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/me/newdir


any idea why /home/me/newdir is not first in the PATH? And how to have it first?

Thanks,
 
Old 09-08-2012, 01:23 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
is this a joke?
 
Old 09-08-2012, 01:39 AM   #3
djmb
LQ Newbie
 
Registered: Feb 2011
Location: Paris
Distribution: Debian Wheezy amd64 xfce desktop
Posts: 23

Original Poster
Rep: Reputation: 0
Well no it is not. I guess there is something that I have not fully understood. Anything more constructive maybe?
 
Old 09-08-2012, 02:22 AM   #4
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
Your directory is not the first in PATH because you just put it at the end with:
Code:
PATH=$PATH:[yourdir]
This statement associates the variable PATH with $PATH (the previous content of PATH) followed by ":" then [yourdir].
You just have to reorder the assignment, like this:
Code:
PATH=[yourdir]:$PATH
 
1 members found this post helpful.
Old 09-08-2012, 02:44 AM   #5
djmb
LQ Newbie
 
Registered: Feb 2011
Location: Paris
Distribution: Debian Wheezy amd64 xfce desktop
Posts: 23

Original Poster
Rep: Reputation: 0
ok, now I get it. Thanks,
 
Old 09-08-2012, 03:15 AM   #6
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
Mark the thread as solved, then
 
Old 09-09-2012, 01:55 AM   #7
djmb
LQ Newbie
 
Registered: Feb 2011
Location: Paris
Distribution: Debian Wheezy amd64 xfce desktop
Posts: 23

Original Poster
Rep: Reputation: 0
done. I didn't know how it worked, sorry. Thx again,
 
  


Reply

Tags
path



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] GRUB2 Debian Squeeze change boot order? prudra Debian 9 10-07-2011 12:21 AM
Various segmentation faults Debian Squeeze Virtualbox running on Debian Squeeze host fordwrench Debian 1 07-21-2011 03:55 AM
Cannot change keyboard shortcuts at Debian Squeeze ge0rge007 Debian 3 12-02-2009 10:40 AM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 01:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration