You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Personally, I'd never use '-' in a env name, since it would behave unexpectedly in ${} syntax, eg ${FOO-bash} would look for FOO and if unset return the string 'bash', rather than looking for FOO-bash. So this sounded wrong to me, but on doing some research to satisfy my own curiosity, it's allowed;
Activity
LucidDan commentedon Jan 28, 2026
Personally, I'd never use '-' in a env name, since it would behave unexpectedly in
${}syntax, eg${FOO-bash}would look forFOOand if unset return the string 'bash', rather than looking forFOO-bash. So this sounded wrong to me, but on doing some research to satisfy my own curiosity, it's allowed;Kubernetes allows any character except '=': https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
POSIX is slightly stricter and has some recommendations, but still mostly allows anything except '=': https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html
I was just satisfying my own curiosity looking this up, but hopefully the links I found are useful context.