this is a great question
env(1) can also be used to illustrate

        env - Z-A=za ZZ=zz ksh -c 'env | grep ^Z'

from posix

  Environment variable names used by the utilities in the Shell and
  Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase
  letters, digits, and the '_' (underscore) from the characters defined
  in Portable Character Set and do not begin with a digit. Other
  characters may be permitted by an implementation; applications shall
  tolerate the presence of such names.

the last sentence is interesting
it contains the non-standardese term "tolerate"
there are only 4 uses of this word, 3 in the rationale,
so this is the only "official" usage

ksh as far back as ksh88i (that's as far back as I go) drops
non-portable vars from the environment

I'll defer to dgk on the rationale

bash does pass non-portable env vars through,
but its builtin export lists

        export Z-A="za"

which fails when passed back into bash

so any answer is probably a bit more complicated
maybe "tolerate" means "ignored but retained"

On Fri, 26 Sep 2008 14:38:03 +0200 =?UTF-8?B?VG9tw6HFoQ==?= Smetana wrote:
> Hello,
>   I'm having problem with tcsh/ksh interaction:
> tcsh allows an environment variable to contain a hyphen in its name, so the
> following would work in tcsh:

> setenv a-b foo

> However when starting ksh from tcsh such a variable is not visible in ksh's
> environment and it is not passed on when e.g. starting another tcsh instance
> from ksh.

> My question is: shouldn't be such variables tolerated in the environment?

> Thanks in advance for the answer.

> -- 
> Tomáš Smetana
> Sr. Software Maintenance Engineer, Red Hat
> RH IRC: #brno #devel #base-os #seg-team; Freenode IRC: #fedora-devel

> _______________________________________________
> ast-users mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-users

_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to