Re: How to add a new dir to my PATH?



On Sun, 5 Feb 2006 19:43:00 -0500
Dan Martins <dan-martins@xxxxxxxxxx> wrote:

On Sun, Feb 05, 2006 at 02:31:52PM -0200, Bruno Buys wrote:
I am trying to figure out which file I shall edit, in order to add an
extra dir to my PATH ($HOME/bin).
If I log on to my debian sarge in text mode, my .bash_profile is read.
If I log right to X (kdm), it doesn't. The same happens to .bashrc.
Thanks!


~/.bash_profile should be read when the shell is opened as a login
shell, ie. from the console you enter username and password.

~/.bashrc should be read when a shell is opened through xterm, aterm,
Konsole, etc.

The easiest thing i've found is to add "source ~/.bashrc" to
.bash_profile and "export PATH="......"" to ~/.bashrc

The only reason i can think of not to do this is if your .bashrc and
.bash_profile set up your shell differently from each other. In my case
they're both empty except for changing my $PATH. If you run into trouble
I guess you could change your $PATH variable in a different file and
then source that file from both bash scripts.

Anyone see a problem with this?

fwiw, my system has no ~/.bash_profile and my ~/.bashrc sources /etc/profile which is the global profile.

A


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact
listmaster@xxxxxxxxxxxxxxxx



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx

Attachment: pgpCmb7WC01HP.pgp
Description: PGP signature



Relevant Pages

  • Re: How to add a new dir to my PATH?
    ... If I log on to my debian sarge in text mode, ... shell, ie. from the console you enter username and password. ... If you run into trouble ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: How to add a new dir to my PATH?
    ... If I log on to my debian sarge in text mode, ... shell, ie. from the console you enter username and password. ... If you run into trouble ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: How to add a new dir to my PATH?
    ... The same happens to .bashrc. ... shell, ie. from the console you enter username and password. ... If you run into trouble ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: [OT] How to add fortune output to terminal
    ... .bashrc from .bash_profile. ... So the test for $PS1 works without needing to ... it is started over a remote shell. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: why does the shell show commands foolishly when I press UP key?
    ... Can the shell be more smart? ... Put this line into .bashrc: ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)