magicant / yash

Yet another shell
http://magicant.github.io/yash/
GNU General Public License v2.0
330 stars 30 forks source link

'typeset' and family accept invalid identifiers #28

Open magicant opened 1 year ago

magicant commented 1 year ago

(This issue was originally filed at https://osdn.net/projects/yash/ticket/39386 by @McDutchie)

$ readonly a\ b=c
$ readonly a\ b=d
readonly: $a b is read-only
$ echo ${a b}
syntax error: invalid character ` ' in parameter expansion

If that is an invalid expansion, then 'readonly' should not have succeeded either.

$ export a\ b=c
$ env | grep ^a\ b=
a b=c

Allowing identifiers with spaces to be exported also does not seem like a good thing.