From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24407 invoked by alias); 7 Jun 2015 01:23:29 -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: 35407 Received: (qmail 10578 invoked from network); 7 Jun 2015 01:23: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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=AAwYP4cGNy5hqF4hzVy65mTvynLaw26H6gazYcXbFuM=; b=VlNvj9a0LFx2KYadqQWqtdv/irzIqlHJbskVeTlO99ZfSzZvuhGDBvCU7/zItW0mBK 0L5Ey1G5c/ls5I4/wCImgZD5+swT1B2PTP8yy+xqQ/uypBYaGpQJOOn278e7PkQcjIwM 6fKkKvx4DLLArjkv9fx/mH6z2rEH0Ejs36h7D2ZlMjxNDzkVH3jDKL+Ripm5/Mav/KAl XCseYIJEzMj1y/OUOQCqvWwehjloP1sbvwkkzqTHbVDMACng9EIOMSlgt07fnCshzWQI 0OiSi/7lrZs7Py9604s52avgdwdXiXavkjv8Pw3pTg7jnhXItENKFZLmLdRI2hi1tY4s 9D2w== X-Gm-Message-State: ALoCoQlmyj02F8YBfiAUY/N46O6UR5OyFanUDD72Y/LCXF/1OqQ3mgijtFLiIuStk4cMMWQKPpCx X-Received: by 10.60.178.33 with SMTP id cv1mr8815994oec.11.1433640202089; Sat, 06 Jun 2015 18:23:22 -0700 (PDT) From: Bart Schaefer Message-Id: <150606182318.ZM692@torch.brasslantern.com> Date: Sat, 6 Jun 2015 18:23:18 -0700 In-Reply-To: <6697841433637291@web4o.yandex.ru> Comments: In reply to ZyX "Re: In POSIX mode, ${#var} measures length in bytes, not characters" (Jun 7, 3:34am) References: <55738EFE.1050805@inlv.org> <6697841433637291@web4o.yandex.ru> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "zsh-workers@zsh.org" Subject: Re: In POSIX mode, ${#var} measures length in bytes, not characters MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.