You are not logged in.

#1 2009-06-06 09:54:41

mateusz.f
Member
Registered: 2009-04-17
Posts: 46

adding $home/bin to user path

Hi,

Anyone knows how to add bin directory to the PATH environment variable? I tried the /etc/profile and /etc/environment but I  think that $HOME is not available at the moment of running them. So next thing was to try .profile in user dir, but it's not run when I use startx with awesome wm and urxvt / zsh combination. What I would like is to have a shell agnostic solution which would work for all users.

Thanks,
Matt

Offline

#2 2009-06-06 09:59:01

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: adding $home/bin to user path

# ~/.bashrc <- right here to avoid duplicates entries when using a shell in a shell in a shell 
PATH=${HOME}/bin:${PATH}
# or
PATH=${PATH}:${HOME}/bin
# depending on which "bin" you want to give higher priority

export PATH # for good measure

Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#3 2009-06-06 09:59:52

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: adding $home/bin to user path

Can you stick in in ~/.xinitrc given you are using startx?

Offline

#4 2009-06-06 10:02:24

mateusz.f
Member
Registered: 2009-04-17
Posts: 46

Re: adding $home/bin to user path

Thanks, but I need something more general

klixon:
I think this is bash specific. I'm not sure if it will be called when I use zsh.

allan:
I would like it to be default when I add new users

Offline

#5 2009-06-06 10:11:10

mateusz.f
Member
Registered: 2009-04-17
Posts: 46

Re: adding $home/bin to user path

As far as I remember it works on Ubuntu. Maybe I'll try to mount my Ubuntu partition and check it.

Offline

#6 2009-06-06 10:17:28

mateusz.f
Member
Registered: 2009-04-17
Posts: 46

Re: adding $home/bin to user path

Ok, on Ubuntu lines responsible for adding bin to path are in ~/.profile. I think it is a good place for the functionality. What I will do is to source it in xinitrc, so it should work on terminals and in X. Then I'll modify the user skeleton directory.

Thanks for help,
Arch rocks smile

Offline

#7 2009-06-08 20:16:50

keegan
Member
Registered: 2009-05-12
Posts: 54

Re: adding $home/bin to user path

Have you looked in /etc/profile ? I think you can set it system-wide there.

Offline

Board footer

Powered by FluxBB