You are not logged in.

#1 2014-09-16 11:16:47

ysetdng
Member
Registered: 2014-05-02
Posts: 42

[SOLVED] printenv output differs from settings in /etc/profile

Hi, I just noticed that

printenv PATH

gives me something else (just '/usr/bin') than is defined in /etc/profiles, which is

PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"
export PATH

I'm using fish but there is no entry about variables in ./config/fish/config.fish.

Thanks for your help!

Last edited by ysetdng (2014-09-16 23:05:56)

Offline

#2 2014-09-16 13:53:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] printenv output differs from settings in /etc/profile

What's the output of 'echo $PATH'? Can you run commands from /usr/local/* anyway?

Offline

#3 2014-09-16 14:02:23

ysetdng
Member
Registered: 2014-05-02
Posts: 42

Re: [SOLVED] printenv output differs from settings in /etc/profile

'echo $PATH' gives the same as printenv and no, I can't run commands from /usr/local/bin.

Offline

#4 2014-09-16 18:29:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] printenv output differs from settings in /etc/profile

I'm not using fish, but the file should be named /etc/profile (like in the thread title), not /etc/profiles (like you did in your first post).
Reboot and see if it gets fixed. If it's not fixed, grep your /etc and other configs to see where are you exporting your PATH - other that /etc/profile of course.

Offline

#5 2014-09-16 20:56:08

ysetdng
Member
Registered: 2014-05-02
Posts: 42

Re: [SOLVED] printenv output differs from settings in /etc/profile

First of all, sorry, it should have been /etc/profile, my bad.  Second, thanks a lot for the input, I found out that the wrong PATH variable came from /etc/login.defs and apparently /etc/profile gets only read by login shells, at least I found that information on the Ubuntu forums.  Will put the right PATH declaration under /etc/login.defs now.

Cheers!

Offline

#6 2014-09-17 21:46:01

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] printenv output differs from settings in /etc/profile

Let /etc/login.defs be, it isn't supposed to have the full PATH.

Read https://wiki.archlinux.org/index.php/Fi … leshooting

Arch wiki wrote:

If you decide to set fish as your default shell, you may find that you no longer have very much in your path. You can add a section to your ~/.config/fish/config.fish file that will set your path correctly on login. This is much like .profile or .bash_profile as it is only executed for login shells.

if status --is-login
        set PATH $PATH /usr/bin /sbin
end

Note that you will need to manually add various other environment variables, such as $MOZ_PLUGIN_PATH. It is a huge amount of work to get a seamless experience with fish as your default shell.

Offline

Board footer

Powered by FluxBB