From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23434 invoked from network); 22 Apr 2021 15:04:40 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 22 Apr 2021 15:04:40 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619103880; b=vJ8YI74OzoW7hiFB1V4wivAtov90mbjYJsDlxdi8JHaOfCq7UBltsaGSU25KdjSFaeQ7YiZE+p /IDm9cImaw77SkU//XtdA5pQaXZmTpFafUH/bd+aznuw0VmxuuPF8Pv+F50Ih/7K0jsjezEfCp zJeiGsXz8sf/5OCDkPH+ZyglSaiXQWIlvKorybY1w9AXalct7EDYGgeHIh06AkLugNJ7YCErau nvMhyNwvGliDaw7SBF+m8yqFQ33EtArl8xfDSAr7XRg4V5H4g2ii6xXYEax4vO47lzIr78E1yb +h8X0OA1M0rrplft2RQxBbNrlWzrusUGyqmVkGzVf1s2ug==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619103880; bh=XYd0/rr8jziR1pFZDX2hLROmAnazUTONQ95ZHu3SBck=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=pcQFxUuHjLXdHgdvfq8PBDrM5IA5PDhwSUHc8LmKb5lPEVvMpxgKXYGtg0vxL6dRld2OKRwCKr IYFDXehiAW9j124dbupcA5x8SL9rYTJBR/Lcs7/iZEua4/c6zqXlU6N+pcG4MuCKcpyml5xaeH cS5ZgO58ipdYZy0WCtJLnqYYgijv5/UatospbQHOKrkfN+NIxkq0e8F9b4VxuXnfzBECEoRWlT grTAISqR0XHfDFWfE1z0qnAUlbd9FR2qjz08G1o0qia6Le9BjXDdW5F+YcwkgUVliKVGNwnHU5 eIEHfY4OehFqxNEpPS0e1XWERbAAlddDZqd7Vl1+tfcLeA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=0H5INEQ3uHzuK1vzpdSRQaVJLrxKrnWgpUT+gn5yduo=; b=j/uJvtvq3/jJnZ0QR+hirXHAxm KrNhPB1ZfdSACQVeKa1zrvJlLI1b8w1tUB4z8wcvT6zAkIbup3S44Igh8b//iuPFCO2byEC9cb28N frEh+DHpACzHNzp2xq4Ai2BpU1OwYz/uXEegXS6valyWYRo0KmwvYcXbd0D6OzDyHo2c+rHOiX/Kf bS4+CBEGVjobufTuZGknAafLtxwJjMbshgPVfstcQy//8OZJF/4Ji+0MYGlQT3FBzBhRtAq/idldk i/Z+KCfD2KRrU7Hr65erPVK4sYqmAakD2bO/EeFIpeoRWYvIHR4IxUU99GZvi9gylspnidOPkzGEK BcmrS+1Q==; Received: from authenticated user by zero.zsh.org with local id 1lZasd-0007St-Im; Thu, 22 Apr 2021 15:04:35 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:52868) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lZarb-0007E2-IF; Thu, 22 Apr 2021 15:03:37 +0000 Received: from smtp-zira.vinc17.net (lfbn-tou-1-1431-42.w90-89.abo.wanadoo.fr [90.89.233.42]) by joooj.vinc17.net (Postfix) with ESMTPSA id F0E58239; Thu, 22 Apr 2021 17:03:30 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 83C80C22A6D; Thu, 22 Apr 2021 17:03:29 +0200 (CEST) Date: Thu, 22 Apr 2021 17:03:29 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: sh emulation POSIX non-conformances (no word splitting upon arithmetic expansion) Message-ID: <20210422150329.GC154089@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <7FD930F4-37CD-402B-9A06-893818856199@dana.is> <20210411175726.hxnm33mxoska2tsm@chazelas.org> <20210411191805.4sifipeo7so4wdnd@chazelas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210411191805.4sifipeo7so4wdnd@chazelas.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.0.6+158 (8162c129) vl-132933 (2021-04-22) X-Seq: 48655 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2021-04-11 20:18:05 +0100, Stephane Chazelas wrote: > 2021-04-11 18:57:26 +0100, Stephane Chazelas: > > Some non-POSIX conformances I can think of ATM: > [...] > > Another one: > > $ zsh --emulate sh -c 'IFS=2; printf "<%s>\n" $((11*11))' > <121> > > While POSIX (beleive it or not) requires: > > <1> > <1> > > Again, that's one of the cases where many shells (most ash-based ones, > pdksh, yash at least) behaved like zsh but switched for POSIX > compliance (even though that hardly makes sense). I disagree. I think that the fact that $((11*11)) behaves in a way similar to parameter expansion makes more sense and is less surprising: $ sh -c 'foo=121; IFS=2; echo $foo $((11*11))' 1 1 1 1 $ zsh --emulate sh -c 'foo=121; IFS=2; echo $foo $((11*11))' 1 1 121 $ If something hardly makes sense, this is "IFS=2". -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)