[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How To Permanently Add-to a Users PATH Statement in the Bash Shell



On Tue, Jul 07, 2020 at 10:16:21AM -0400, Greg Wooledge wrote:

> Gods, I am so tired of this question and having to repeat my demands
> for BASIC information over and over.
> 
> Here are some resources for those of you who refuse to reveal any of
> the necessary background information to get answers, and would rather
> hoard all of your details under the guise of "privacy" or whatever.
> 
> https://wiki.debian.org/Xsession
> https://wiki.debian.org/EnvironmentVariables
> https://mywiki.wooledge.org/DotFiles
> 
> That is nowhere NEAR a comprehensive overveiw of every possible piece
> of every possible configuration, but it's a starting point.


I faced this issue a few years back, doing a Linux console login (manual crypt bindmount for $HOME), setting some env functions in BASH, and very naievely thinking they would appear in my Bash shells within a manually launched XFCE __session__!

The complexity of this is interesting:

 - XFCE acts as, or uses, Dash or something that does not propagate shell functions in the parent env

 - this is despite that functions are essentially "fancy vars" which are `eval`ed

 - so launch startx, figuring out over many failures to start "modern" "sessions"

 - eventually `dbus`es, keyboards, USB disks and everything works at least marginally

 - discover that your initial default session, spanning 2 monitors, 9 desktops, and with an official gazillion terms, is a little <ahem> slow, to start

 - decide that the best way to speed things up is to reduce your 600+ shell function env init overhead - which was hitting twice for every term, because TMUX :D

 - and since we're doing a pre-X Linux console based initial login, what better reduction than to have a single environment inherited by all sub processes including shells?

 - but alas, XFCE would not propagate shell functions

 - so try somewhere in the session startup apps - nope, courdn't figure it out at least

 - ended up bypassing the session entirely and learning how to ride the "bash handles your multiple Xorg monitors" bronco, beautifully laying out those "official gazillion" terms - with one Master Of The Bash Universe (MOTBU) wielding the all powerful One Term to Rule Them All - or at least, that's how it felt :)  And the One Term (naturally shortened of course to just The One) loaded up it's env with all those juicy functions _before_ launching all the others

 - as a bonus, this Uber One Term get up, would be usable in any desktop session, not limited to the XFCE I was using


It shall be tidied up and drip fed in a torrent of git lollies to the screaming hoards, hopefully not too far away ;)

Create your world,


Reply to: