Nick Chambers
2018-04-29 05:58:18 UTC
Using bash 4.4, I am able to replicate this on both macos High Sierra
and Ubuntu 17.10. Why does the following not show foo as an
environment variable?
ubuntu:~ nchambers$ clear
ubuntu:~ nchambers$ foo=bar compgen -e
CC
CXX
EDITOR
HOME
LANG
LOGNAME
MAIL
PAGER
PATH
PS1
PWD
SHELL
SHLVL
TERM
USER
_system_arch
_system_name
_system_type
_system_version
ubuntu:~ nchambers$
I am not attempting to use this for anything practical, just happened
to notice it during a quick example I was writing.
and Ubuntu 17.10. Why does the following not show foo as an
environment variable?
ubuntu:~ nchambers$ clear
ubuntu:~ nchambers$ foo=bar compgen -e
CC
CXX
EDITOR
HOME
LANG
LOGNAME
PAGER
PATH
PS1
PWD
SHELL
SHLVL
TERM
USER
_system_arch
_system_name
_system_type
_system_version
ubuntu:~ nchambers$
I am not attempting to use this for anything practical, just happened
to notice it during a quick example I was writing.