🐧 I didn't realize how nuanced it is to apply global environment variables to any shell in any context. It'd be nice to see something maybe added to the kernel that supports this I don't know if that's right spot for that. I don't know how else you co
Nachrichtenbereich: 🐧 Linux Tipps
🔗 Quelle: reddit.com
The concept of a global environment a variable that runs in every context is specific to the system. What do I mean by this?
I want FOO=bar to exist for everything that runs on the system. How would you go about this?
Some people are going to say /etc/environment. Okay that's if that .profile is set up to source that sure. And then off the top of my head I'm not sure if that's for non interactive shells. Well put it in your bash.rc. So first what if my shell isn't bash? From what I'm reading sh is USUALLY bash emulating sh. But I think sh can actually be a different flavor of shells. Then again off the top of my head I don't think it works in non interactive. But then what if I use zsh? Then when you get into docker you've got all sorts of different stuff going on. Different images are going to do all sorts of different things.
I'm just surprised this late in the game there's not some way to set a global environment variable that is universal to the entire system across every system.
[link] [comments] ...