I am working on coding my own shell (As close to bash as possible), I am working on wildcard expansion and I've seen strange behaviour using export with asterisks.
bash-3.2$ touch TEST=a
bash-3.2$ touch TEST=b
bash-3.2$ echo TEST=*
TEST=a TEST=b
bash-3.2$ export TEST=*
bash-3.2$ env | grep TEST
TEST=*
It seems like the asterisk expands in some cases, but not in the case of a call to export, which doesn't make much sense. Is there a rule in bash that I would have missed which would explain such behaviour?