[Help-bash] Why does foo=bar compgen -e not show foo as a name?
From:
Nick Chambers
Subject:
[Help-bash] Why does foo=bar compgen -e not show foo as a name?
Date:
Sun, 29 Apr 2018 00:58:18 -0500
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.