I am trying to get shell variables in the system rc file to be global for all shell scripts. The export command only seems to provide this for scripts run directly from the rc file.
Where/how are the system PATH, SHELL, HOME vars defined, since they are global.
Spoke too soon. Global variables created in profile are present only when logged in, so they are useless for autonomous (autolaunch) configurations like mine. I am just looking for a way to define the network settings in one place, yet have them available system-wide.
What do you mean by "in one place" ? What do you mean by "system-wide" ?
To provide some information "system-wide" it can be stored in a file and thus is is "in one place".
If multiple shells are started "export" variables only are copied to the shells' environments, if one is spawned by another. Shells also can be spawned by other programs (e.g. init or telnetd) independently from the shell tat interprets the start up script(s) (usually something like "rc").
Some shells look at one or more config file(s) that allow(s) (e.g.) for executing a script before a prompt is shown.
If your shell(s) are used to run scripts, you can simply start each script with "sourcing" (calling) a central standard script (e.g. ". /etc/setvars") ("." means "source": don't spawn another shell).
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.