libera/#devuan/ Thursday, 2023-01-26

Guest46hi guys, hope everyone's doing well. I'm trying to get ~/.local/bin on my system's PATH01:56
gnarfaceeasy to do01:56
Guest46well I want it to whenever I log in01:56
phoggFor just one user, or for all users?01:57
Guest46either or]01:57
Guest46it looks like .profile add .local/bin by default01:57
Guest46but for some reason .profile isn't running when bash starts, I don't understand why01:58
phoggGuest46: this explains why: PAGER='less +/^INVOCATION' man bash01:59
gnarfacei've seen some graphical login managers/window environment combinations bypassing .profile01:59
gnarfaceusually you can just get around it by adding it to your startup options02:00
phoggtl;dr ~/.profile is only read for *login* shells, and the only if ~/.bash_profile and ~/.bash_login are not present02:00
XenguyThere's also ~/.bashrc to consider; one file often references another02:00
gnarfaceyea it's usual for the profile to reference .bashrc02:00
Xenguyyep02:00
gnarfacebut the path manipulation i've always seen in the profile02:00
phoggGuest46:  if you are really in bash you can resolve this by careful setup of ~/.bashrc ~/.bash_profile and ~/.profile -- but if it's some non-shell location you may, as gnarface says, have never used ~/.profile at all02:01
gnarfacein fact the default stock profile should have a commented-out example entry for adding ~/bin to your PATH02:01
Guest46would it be safe to run .profile from .bashrc then? does .bashrc apply to an interactive shell?02:05
phoggIf you want your bash env to always be consistent my advice is to have ~/.bash_profile contain one line: source ~/.bashrc; then, in ~/.bashrc start by sourcing ~/.profile, and then have ~/.profile start with a line that sources /etc/profile to match login shell behavior. After that put all remaining shell rc at either the end of ~/.profile or the end of ~/.bashrc02:05
phoggthis way you get the same results (with some wasted effort) for login and non-login bash shells, and you get as much of it as possible for non-bash shells that only respect profile02:05
phoggGuest46: again, the man page reference I linked explains this concisely and completely. Briefly, yes (if by run you mean source) and yes, but not always.02:06
Guest46alright I'll do some more reading. thanks.02:08
gnarfaceGuest46: it's your system so you should make it how you want, but traditionally you'd put stuff in .profile or .bash_profile that you only want in login shells, and you put stuff in .bashrc that you want in both... there's some reasons why they're separate03:01
gnarface(it's normal to load .bashrc from .profile but it's not normal to also load .profile from .bashrc)03:02
gnarface(nothing will stop you from doing it both ways though, have fun)03:03
FatPhilI have a little multiple-sourcing check - they both look for the absense of an environmental variable before doing the source10:02
FatPhilI think I prefer phogg's advice of bouncing between bash_profile, bashrc, and profile. Not sure if bashrc should start or end with the sourcing of the profile though. That's a philosophical question.10:07
clemens3rm .profile; echo source ~/.bashrc > .bash_profile13:55
debdogFatPhil: no philosophical question there. bashrc is sourced by all shells while profile is supposed to be sourced by login shells.14:02
debdog..only.14:02
u-amarsh04yay, libreoffice 4:7.4.4-8 is installable14:45
Death_SynHey there!  I've got some stale connections showing in the pg_stat_replication view that I'm trying to figure out how to get rid of.  Unfortunately, they all share the same application name with one connection that IS working properly.  How can I drop these rows that show in state 'startup'?15:41
Death_Syn(without breaking the working connection)15:41
Death_Synerr15:42
Death_Synwrong channel, apologies15:42
FatPhildebdog: yes, but should your .profile run in the context of a properly configured shell - i.e. at the end of your .bashrc, or should .bashrc run in the context of your one-time login-specific .profile settings? Noone's arguing against the statement that you just made.19:21
debdoghmm, ok, I think I understand now19:28
phoggdebdog: Re: bashrc, it is a philosophical question. Should there be login-time shell rc and separate non-login-time shell rc? Should some things happen at both times? Reasonable people can disagree. The reason not to rm ~/.profile is in case you ever want to use sh and have some of your config e.g. PATH be set.22:00
phoggHappy to discuss it further in -offtopic if you like.22:01

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!