Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 475  / 2 Years ago, mon, april 18, 2022, 6:41:47

Which file(s) assigns the preset Environment variables listed by bash printenv or env on Lubuntu (LXQt & LXDE, if they are different)?
Are the same files used for other:



  • Debian-based distros

  • Non-Debian distros (Red Hat family, Arch)


TIA!


More From » bash

 Answers
1

most of them are defined in relevant files in the /etc directory. running grep -r ^[[:upper:]] /etc/* must list most of them.
a few particularly interesting files according to the Ubuntu documentation are:



  1. /etc/environment: documentation states



"...This file is specifically meant for system-wide environment variable
settings. It is not a script file, but rather consists of assignment
expressions, one per line..."




  1. files in the /etc/profile.d directory ending in .sh. documentation states:



"...An alternative is to create a file for the purpose in the
/etc/profile.d directory... Files with the .sh extension in the
/etc/profile.d directory get executed whenever a bash login shell is
entered (e.g. when logging in from the console or over ssh), as well
as by the DisplayManager when the desktop session loads..."



[#2916] Tuesday, April 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iedncommon

Total Points: 200
Total Questions: 95
Total Answers: 132

Location: Tonga
Member since Mon, Aug 2, 2021
3 Years ago
iedncommon questions
Sat, Jun 4, 22, 18:20, 2 Years ago
Mon, Apr 4, 22, 08:10, 2 Years ago
Tue, Jul 6, 21, 15:11, 3 Years ago
;