From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26620 invoked by alias); 7 Oct 2015 13:15:28 -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: 36810 Received: (qmail 28443 invoked from network); 7 Oct 2015 13:15:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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=URWrUE1kdybba26DMhXephV8Be66MbXo72DVLRCYqBM=; b=rkH96PYA5cRt91B3U4s+WGdDRlKt6JL4rYZZRkrUUhVTlmLtjTWOAUa2PJ8J2u8G7u tJfoL6OUFjGVjYJDTJaxzXM+uFZkmWJLY+7fcX0MYct2JmlJp92PyQCW3irN64R+0EvL fhdPTAcivJU+AugSEgAL/+uVpcIU9bAmfTUdLjG5dmJDUaDhWvy2RLE+wrXKJUGAUeUJ UDk/QT5tcHWtvGqht4OkRf3u2z6BFQYVuEGlR0o+sESE/yu2HBLC4R6lieqYWfzq5C/f 152rYgbPw9nhW6KuIXj0/6j8GrAzrIoxyt3gVg/ScJJTxP0E3ikdMKGb0MwOd9Oj4y59 7YvA== X-Received: by 10.180.89.101 with SMTP id bn5mr1746247wib.20.1444223724785; Wed, 07 Oct 2015 06:15:24 -0700 (PDT) Date: Wed, 7 Oct 2015 14:15:23 +0100 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: ["regression"] =?iso-8859-1?Q?St=E9pha?= =?iso-8859-1?Q?ne=3D_1_zsh_-c_'echo_$St=E9phane'?= Message-ID: <20151007131522.GA7627@chaz.gmail.com> Mail-Followup-To: Bart Schaefer , Zsh hackers list References: <20151006110401.GA9868@chaz.gmail.com> <151006084416.ZM5546@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <151006084416.ZM5546@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2015-10-06 08:44:16 -0700, Bart Schaefer: > This is discussed in the thread starting at workers/34004 and leading > up to workers/34015. > > Nobody ever commented on whether the environment is allowed to contain > names with the high-order bit set, but POSIX identifiers cannot, so it > stands to reason you can't import something with that shape of name. Note that it's not so much about the 8th bit (0-9 in EBCDIC have the 8th bit set), but about being _, letters and digits in the portable character set (0-9 a-z A-Z _). POSIX doesn't forbid shells importing whatever they want from the environment AFAICT. Only a POSIX application (script) must not make use of those that are not valid POSIX identifiers. IOW, env Stéphane=1 sh -c 'echo "${Stéphane}"' is an invalid inline-script, so it doesn't matter what sh does with that Stéphane environment variable (as long as it's passed along unmodified to the commands it executes, though not all shells do it, and there was a discussion about it some time ago: http://thread.gmane.org/gmane.comp.standards.posix.austin.general/690 ) > zsh -f -o posixidentifiers -c 'Stéphane=2; echo $Stéphane' > zsh:1: command not found: Stéphane=2 > éphane > > In effect the environment is always treated as POSIX_IDENTIFIERS. > > POSIX_IDENTIFIERS > When this option is set, only the ASCII characters a to z, A to Z, > 0 to 9 and _ may be used in identifiers (names of shell parameters > and modules). [...] Note that while POSIX (AFAICS) requires $Stéphane to be treated as ${St}éphane, ksh93 and bash (in single-byte character locales) don't. The behaviour for ${Stéphane} would be unspecified, so implementations may do whatever they want there. Now, I won't be the one complaining if I can't use $Stéphane or ${Stéphane} as a variable name, I never liked the idea of the syntax of a script being dependant on the locale. -- Stephane