2014-10-16 15:09 GMT+02:00 Chet Ramey <chet.ra...@case.edu>:

> On 10/15/14, 1:49 PM, lorenz.bucher....@rohde-schwarz.com wrote:
>
> > But anyway.
> > In my opinion I should trust a shell not violating their own rules and be
> > able to import their own variables.
>
> That's not the issue.  The shell can import variables like that just fine,
> as evidenced by exported functions actually working.  The question is
> whether or not `export' lets you set and export non-identifiers.  It does
> and should not.
>
> > So the % character should be allowed to be used in variable names.
>
> No, shell variable names should continue to be shell identifiers.  You
> can already use `%' (any character, really) in environment variable
> names.


Regardless though, shouldn't source <(declare -xp) work whether or not
the environment contains invalid identifiers? It doesn't at present:

$ env %=% bash -c 'echo "$BASH_VERSION"; source <(declare -xp)'
4.3.30(1)-release
/dev/fd/63: line 1: declare: `%': not a valid identifier

Isn't declare -p output meant to be reusable as shell input?

-- 
Geir Hauge

Reply via email to