From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5138 invoked by alias); 7 Jun 2015 01:34:57 -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: 35408 Received: (qmail 11928 invoked from network); 7 Jun 2015 01:34:54 -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=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FSL_HELO_BARE_IP_2,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=no autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1433640471; bh=QLHq+StC92Qr0xtskV9uY5j0OFMFK7PDsjljUpLTjfo=; h=From:To:In-Reply-To:References:Subject:Date; b=o9OtuTLLKNgyoULbO3Hsvv1QIXQkr/PxpaVRTBRbufCcof080lbWcYH1yGo26hbbJ x26MzWyK9W+KV2qpZ5VaWndj5buIZcPP5hdSFvlplqjiVscCLxMrxjXgUjahreVVKG jAASpuNSIIuNWbL++O8PVv5eZoVyWKrH6ZjX8lG8= From: ZyX To: Bart Schaefer , "zsh-workers@zsh.org" In-Reply-To: <150606182318.ZM692@torch.brasslantern.com> References: <55738EFE.1050805@inlv.org> <6697841433637291@web4o.yandex.ru> <150606182318.ZM692@torch.brasslantern.com> Subject: Re: In POSIX mode, ${#var} measures length in bytes, not characters MIME-Version: 1.0 Message-Id: <776081433640470@web11j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 07 Jun 2015 04:27:50 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r 07.06.2015, 04:24, "Bart Schaefer" : > On Jun 7, š3:34am, ZyX wrote: > } Subject: Re: In POSIX mode, ${#var} measures length in bytes, not characte > } > } 07.06.2015, 03:29, "Martijn Dekker" : > } > When in 'emulate sh' mode, ${#var} substitutes the length of the > } > variable in bytes, not characters. This is contrary to the standard; the > } > length in characters is supposed to be substituted.[*] > } > > } > Oddly enough, zsh is POSIX compliant here in native mode, but > } > non-compliant in POSIX mode. > } > } Do you have a reference where "character" is defined? This behaviour > } is the same in posh and dash: > > I thought this was discussed on the austin-group list but I can't find a > search term to dig it out of the archives. š(I did find the thread about > ${##} as a side-effect of the attempt.) > > On my Ubuntu 12.04 system, /bin/sh is a link to dash, so zsh invoked > as sh behaves like /bin/sh. šOn CentOS, /bin/sh links to bash, so they > behave differently. Just checked out busybox (ash), it also emits 2 (recognizes unicode codepoints). Ksh emits 2, mksh 4.