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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24334 invoked from network); 31 Mar 2023 16:40:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Mar 2023 16:40:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1680280814; b=kwqxm5WdMkrrQlnODM99ry/Xmc5aEEHYFdiR1S1fuV6x1KZLISk5aqB+YXho0YsIVmoXzyFUJ2 S1DJU1lLIVN72PJ3fKYUw0El15aY6VpGTPxDxPpIEYnCMVXhDFeJxF0OGhyWqmfi3L/VatLXU5 P74gMoOw/aqGIPC1H2J1RdDNtTnsk7yOLoecC/zZKj2Q1G10/Vn4Qnc+bY+o5PVBleGNJQnXxu 2qGxcjhij3dNimewyeDcjuHmh2QJe5dWmfrhVf0j5mxueFOusCNAA66sIDlkABBT3TjzCE/7LM 2xA3+QZHIxseloQ68IO9JjKO5XOgEl5EyQO0lwSzHnOb1A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (firemail.de) smtp.remote-ip=88.99.137.45; dmarc=none header.from=firemail.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1680280814; bh=CJFCXHJojlLN+8Fs6L4HmqSrx/DsR8dy2Hm9O3WOAR4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:References: In-Reply-To:Cc:To:Reply-To:Subject:From:Message-ID:MIME-Version:Date: DKIM-Signature; b=Ff/jBp89wdvviiwXQa4lTaJ85Bz/zTU4djQ9qXZvvBP2UvgDP0vndWO4ISVEiYfl/6gXeEMuKV W1xBBsT2dG3+VBa2oATkZNUjh5Bc/ayaEfnWG9UsbRvSs99HhP2onNkBNAuzUkBvcIpjvH1M3V LKmoQgYgp2iUpl/9HqpzcEmgn/ydeKIDUePHRAsMoHG8+gSx2MsdTjYpYkbb5gD6vXUntsN/Qa 9nKDYl8Z3uEdI6HAHLxaA8gzz1hJzXA+t1KpFBpMHc/9KjVGn2RTprNn8A3Tl9hPNgFqv8OIxt trgD+kL5K9Bgvp/HYR3/Ktz4xbroYeivCXjntl9yUB7ybQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Cc:To:Reply-To:Subject:From:Message-ID: MIME-Version:Date:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=AcPHEgTrvmxZYEjgjZKo4wNHE7ZQtFwwkXdnRaAvjDs=; b=jlLFu1fe/ywm3zAUq/49uFHfni px5atSudcWI9/Ws1Twseh2rNcnRYzY65NgakbYBg2BP2PzPmXX5x15JybTkmB8KwDCmmHxVryHTl6 8YTQgoBjW+TSRe6v2jHL38a+4DojfEai55HjgQ9RDITQ9revsaaB6RaQqrF4C/gw/c1E9allW7qGX +enOqW3Z6dqWj/IWHR2MYzlCJt1DFelRq4qhFwTDJpCiJd5AlJkIkU/h0Pdrm674JqrXip7Ca85D9 8MYjPLfDQL7ud6IfuYEC84Zdwjk2ZMqrkVlamgJ9FUF5gnkRl57JR91zbnxkoTlKEdLTOMFOhBCpK KUxCBd2g==; Received: by zero.zsh.org with local id 1piHnR-0009dy-Fc; Fri, 31 Mar 2023 16:40:13 +0000 Authentication-Results: zsh.org; iprev=pass (firemail.de) smtp.remote-ip=88.99.137.45; dmarc=none header.from=firemail.de; arc=none Received: from firemail.de ([88.99.137.45]:58194) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1piHmB-0008vJ-8n; Fri, 31 Mar 2023 16:38:56 +0000 Received: from firemail.de (localhost.localdomain [127.0.0.1]) by firemail.de (b1gMailServer) with ESMTP id 112BC3B3 for ; Fri, 31 Mar 2023 18:38:54 +0200 (CEST) Date: Fri, 31 Mar 2023 18:38:54 +0200 MIME-Version: 1.0 Message-ID: <1d3d501ae2018b88447df0f07ca86ed6@firemail.de> X-Mailer: b1gMail/7.4.0 X-Sender-IP: 217.232.7.121 From: "Thomas Paulsen" Subject: Re: Discrepancy in IFS handling (zsh is POSIX compliant) Reply-To: "Thomas Paulsen" To: "Felipe Contreras" Cc: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Abuse-Report: abuse@emailn.de X-Seq: 29003 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Hi, indeed an original bourne shell, and ksh88 and ksh94 behave exactly like ba= sh On the other hand, tcsh and the ultra modern fish behave like zsh.=20 Thus, I don't see the need for changing zsh. Let it as it is. It's in proud= companionship.=20 Cheers Tom --- Urspr=C3=BCngliche Nachricht --- Von: Felipe Contreras Datum: 30.03.2023 13:11:46 An: Zsh Users Betreff: Discrepancy in IFS handling (zsh is POSIX compliant) Hi, I was going to report a bug about a discrepancy in the handling of IFS, until I read what the POSIX standard says about it [1]. The example is this: IFS=3D, str=3D'foo,bar,,roo,' printf '"%s"\n' $str In bash there's four fields, the last comma is ignored, in zsh there's five fields. In my system dash and ksh also output four fields, like bash. However, this is what POSIX says: 3.b. Each occurrence in the input of an IFS character that is not IFS white space, along with any adjacent IFS white space, shall delimit a field, as described previously. We ignore all the white space stuff (since we are not using white spaces), and thus: Each occurrence in the input of an IFS character shall delimit a field. In zsh each occurrence of a comma does delimit a field (4 commas, 5 fields), which to me is what POSIX says should happen. So in this particular case it seems zsh is complying with POSIX (even in zsh mode), and all other shells are not. So there's no bug (at least in zsh), I just wanted to let you know what I found, and see if you agreed with my interpretation. Cheers. [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.ht= ml#tag_18_06_05 --=20 Felipe Contreras