You are not logged in.
I added a directory with my bash scripts to the PATH variable in .bashrc:
#
# ~/.bashrc
## If not running interactively, don't do anything
[[ $- != *i* ]] && returnPS1='[\u \W]\$ '
alias ls='ls --color'EDITOR=nano
PATH="${PATH}:/home/s2phs/bin"
When I check the PATH variable after I logged in from the prompt, 'echo $PATH' results in
[phnx ~]$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl:/home/s2phs/bin
After initializing an X session, $PATH contains the /home/s2phs/bin directory twice.
[phnx ~]$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl:/home/s2phs/bin:/home/s2phs/bin
I had to switch to another PC. I installed Archlinux two days ago. I used an image (partimage) of my old home partition to copy it to this PC. I have no idea if the /home/s2phs/bin directory appeared twice in my PATH variable in the previous installation on the other PC. I only noticed it when openbox no longer autostarted some of my scripts from the /home/s2phs/bin directory and I Checked the PATH variable. Maybe the autostarting problem has nothing to do with the PATH variable.
So, why does the /home/s2phs/bin directory appear twice in the PATH variable after an X session is initialized?
Last edited by lnx (2014-04-12 13:17:05)
Offline
Because you put it in bashrc which is read twice by that point. It is read when you log in to the tty, then it is read again when you start a terminal emulator (e.g. xterm) in x.
These settings should not be put in bashrc, but instead in bash_profile.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yep, solved. I put in the .bashrc file because that file is used in the example on the Environment variables Environment variables archwiki page.
Offline
I put in the .bashrc file because that file is used in the example on the Environment variables Environment variables archwiki page.
Not anymore...
Offline