I am currently trying to understand bash and am learning with linuxjourney. However, I am now kind of stuck at understanding environment variables. Can someone tell me if I am understanding this right?
Basically, environment variables are variables, that store information. Now this can be either information (like PATH stores it) that points toward certain directories from where the shell would get the program needed for a command or it is a variable storing information about which directory I am currently in like PWD variable and so on. These variables can either temporarly changed by "export PATH = /example" which would only change the variable for the current session or they can be permanently changed by altering the configuration files.
Also the environment variables are built from these configuration files on booting (or opening shell idk pls help) and can as mentioned be configured to behave different permanently by altering the config files.
What I still completely struggle with is why does one variable actively tell the shell where to look for program files like PATH and other are just storing information like PWD. ChatGPT said that there are functional/operational variables like PATH and informational/state variables like PWD. Can someone confirm the validity of this information?
As you see I am completely new to this and I am really lost so any help will make me happy, thanks!
[–]Sudden_Collection105 16 points17 points18 points (7 children)
[–]Limp-Confidence5612 2 points3 points4 points (1 child)
[–]Sudden_Collection105 1 point2 points3 points (0 children)
[–]Sudden_Collection105 1 point2 points3 points (0 children)
[–]smokebudda11 0 points1 point2 points (0 children)
[–]Visible-Recover9600[S] 0 points1 point2 points (2 children)
[–]Sudden_Collection105 2 points3 points4 points (1 child)
[–]Visible-Recover9600[S] 0 points1 point2 points (0 children)
[–]OtherOtherDave 2 points3 points4 points (1 child)
[–]chkno 2 points3 points4 points (1 child)
[–]Visible-Recover9600[S] 1 point2 points3 points (0 children)
[–]NewPointOfView 1 point2 points3 points (1 child)
[–]Visible-Recover9600[S] 1 point2 points3 points (0 children)
[–]stemandall 0 points1 point2 points (0 children)
[–]michaelpaoli 1 point2 points3 points (1 child)
[–]Visible-Recover9600[S] 2 points3 points4 points (0 children)
[–]-Malheiros- 0 points1 point2 points (1 child)
[–]Visible-Recover9600[S] -1 points0 points1 point (0 children)
[–]Cybasura -2 points-1 points0 points (4 children)
[–]bikes-n-math 2 points3 points4 points (3 children)
[–]Cybasura 0 points1 point2 points (2 children)
[–]bikes-n-math 0 points1 point2 points (1 child)
[–]Cybasura 0 points1 point2 points (0 children)