Timeline for bash: exported function not visible, but variables are
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 16, 2020 at 23:55 | vote | accept | laur | ||
| Sep 16, 2020 at 22:34 | history | edited | Gilles 'SO- stop being evil' | edited tags | |
| Sep 16, 2020 at 22:34 | answer | added | Gilles 'SO- stop being evil' | timeline score: 4 | |
| Sep 16, 2020 at 21:22 | history | edited | laur | CC BY-SA 4.0 | added 18 characters in body |
| Sep 16, 2020 at 21:21 | comment | added | laur | Not exporting all variables; only _load_common is; note in my example above, the __ENV_VARS_LOADED_MARKER_VAR was already in shell, meaning USER_ENVS was not imported. And that's the question - how come this variable was in shell, yet _load_common() was undefined, given they're exported from the same location. | |
| Sep 16, 2020 at 21:14 | comment | added | Kusalananda♦ | It's not clear why you are exporting all your variables and functions. Since you source the bash_envs file, no export is needed. If you sourced your main script (the one that sources bash_envs), then __ENV_VARS_LOADED_MARKER_VAR would be set (and exported) for that shell session. Unset it to trigger the sourcing of bash_envs again. | |
| Sep 16, 2020 at 21:07 | history | edited | laur | CC BY-SA 4.0 | added 15 characters in body |
| Sep 16, 2020 at 20:48 | history | asked | laur | CC BY-SA 4.0 |