From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24290 invoked by alias); 20 Dec 2014 10:08:22 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34021 Received: (qmail 24436 invoked from network); 20 Dec 2014 10:08:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=dZpZv45zgP5sR2P6/cEPy5bccgQFB+qvJhqdD7T2h5c=; b=DMqOs2SZUDrgO1cS2JLbTomWNzctbcWw2nfzxBpMOYugfiCI8rzHQn0bmBmMtXPdf+ RujLz68NZb58XR3QtWYE1yMMNG58eyWlA5IM7F8kBwT4SJZ6NljVEh99rOTaCRD8gcav gKlPQcMo+fFAtEVgq9AN/0D1MnCThkdclzMrC3TdAJmqOb/RkuQZesxh4SgNLT8y3w8O ecG9NP0f1Nfc9FHyoIfseAqvhgGvTBcko6e5pvE10SeprkT2TiYpudcgSZ2v2XiPGWAV XedNnnG5l90mQzN7bTuMs2HO+pYOsXe7BdhILT+UCITYiR/0zZ8b5OMkIHEWT2corFq1 0k+Q== X-Received: by 10.194.62.19 with SMTP id u19mr23666145wjr.0.1419070084093; Sat, 20 Dec 2014 02:08:04 -0800 (PST) Date: Sat, 20 Dec 2014 10:08:02 +0000 From: Stephane Chazelas To: ZyX Cc: Peter Stephenson , "zsh-workers@zsh.org" Subject: Re: [BUG] Unicode variables can be exported and are exported metafied Message-ID: <20141220100802.GA6223@chaz.gmail.com> Mail-Followup-To: ZyX , Peter Stephenson , "zsh-workers@zsh.org" References: <1054131418926765@web2o.yandex.ru> <20141218192917.4df5324b@pws-pc.ntlworld.com> <20141218194758.329bd9ef@pws-pc.ntlworld.com> <20141219181652.GA3996@localhost.mi.fu-berlin.de> <20141219212125.1e1fea6b@ntlworld.com> <798181419029050@web11g.yandex.ru> <20141220001357.GA21647@chaz.gmail.com> <1136161419067647@web17g.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1136161419067647@web17g.yandex.ru> User-Agent: Mutt/1.5.21 (2010-09-15) 2014-12-20 12:27:27 +0300, ZyX: [...] > > (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)? > > -- > > 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. [...] Sorry, I should have tried. I suppose rc being from the 80s uses the 8th bit for parsing/tokening like other shells from that time as well. But the idea remains. In `rc`, you can do: 'my var (with all sorts of characters)' = whatever echo $'my var (with all sorts of characters)' And assuming it was extended to 8bit bytes, that means you can have code that works regarless of the locale of the user since all variable names are allowed. That also simplifies interaction with env vars (though you still have problems with special parameters like $1, $*...). That would mean changing zsh syntax though and I don't think it's really worth it. > By the way, `env` allows empty name. Yes, and you can pass env strings to execve() without `=` in them. -- Stephane