Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] Unicode variables can be exported and are exported metafied



20.12.2014, 03:22, "Stephane Chazelas" <stephane.chazelas@xxxxxxxxx>:
> 2014-12-20 01:44:10 +0300, ZyX:
> [...]
> [about making the shell syntax locale-dependant]
>>  bash: echoes $абв
>
> [...]
>
> You'd have gotten a different behaviour in a single-byte locale.
>
> Related discussion:
>
> http://thread.gmane.org/gmane.comp.shells.bash.bugs/22367
>
> Personally, I think I'd rather shell variable names be limited
> to ASCII [:alnum:]_.
>
> Making the shell syntax locale dependant is a problem in scripts
> (and we're already affected by that to some extent with
> utilities) because there, it's the *author*'s locale that
> matters, not the user's.
>
> (Or else, you could do like rc and allow anything allowed in env
> vars (rc allows any name as long as it's not empty and doesn't
> contain `=`).

`абв=1 rcsh -c 'echo $абв'` emits “line 1: syntax error near (decimal -48)”. Is it the difference between “A reimplementation of the Plan 9 shell” (http://rc-shell.slackmatic.org/) version 1.7.2 that can be found in the main portage tree and the original Plan9 shell? Or maybe I should simply use different syntax (rcsh -c 'echo $PATH' works though)?

By the way, `env` allows empty name.

--

Found this syntax: `абв=1 rcsh -c 'echo $(абв)'` echoes 1. But `абв=1 rcsh -c 'env; абв=10; env; echo $(абв)'` shows that rcsh removes `абв` from the environment and places variable named `__d0__b0__d0__b1__d0__b2` there instead.

>
> --
> Stephane



Messages sorted by: Reverse Date, Date, Thread, Author