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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31403 invoked from network); 30 Mar 2023 15:35:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Mar 2023 15:35:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1680190514; b=lW8DiU0H8WbYdlbOVcrE8mhxCZSiAiBb2IarxcX6yykH+l5+XOD2aDzVgQWYFo5LfkPwqYVWGG LKNHIb11sMRMqtPODyDTamhRRozcX8mQ4Mj9oKF0X7fBzl6QuyBI5/V8lmLrc1494gFsGjAI8B PcSckt3XhPCxdz/gBrXmjVMSxAIG1EYNTfMjwq4Zu38LZOkJkW+HE25eJZ0aCujfyF2AcmFPaz HuzZgkpdb1GaNVLg+VqUPIVGyI7IuYLGcZ260J0NRyZCQPeEaHMXRuS5PnOV6uZsyvS1uj2Pwb pyAWJO6lgyo9F5n0WsvWm94VEMC2qUhPWYwCbeyp/Y/7sQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pj1-f52.google.com) smtp.remote-ip=209.85.216.52; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1680190514; bh=wXCkIq+5UACmIYPFfvPed5iqR+jDE+ePBLXBxpWuZto=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=sBfw+8Hmf30is7PpXqutLhW3mM6006ukXTU5ZNvRctYYRYHPgy3XjvZReNA6VvMZpT2OOL+4XY zF8q/o2U5QPDvO0AQFQZRBLPQzwIVYoVE+j+5U12pWUCWtC194HTeJhsBmZXkekPq05i1ReOua AEsuNcGyYg6MKAOEBzeCAza5N0g31kV7urBoM8kWUoM1M8mdjRgfIy2qdhHtLHxmlFUzvo/fSO KerXJpttMboKdBEg3iGXxImMCsR+WXXWFW1q2BgXVIcZozz2AF0LMBbCsLWhklVfsB4oGRYRle VCs8/c2FeXDmA5nf1W8h8sjBZeh0EWsWxe+lFoiK35EWnA==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=wXCkIq+5UACmIYPFfvPed5iqR+jDE+ePBLXBxpWuZto=; b=VabsSem/h7R6k/zw6P/OEJxmob Sz8xlH9X6xZgNVpRGhU8fJlfvQhey9Y/YiguGsQXEbFy+b1sWhMbrZJSf2F/xvW3CK0TXSAORjrLM V8md3Hc8HzGtkvcsz+CBVC2myB7pWgfFPttArr/dK/8oDNLMCb/qunYnWhOO3I/i2lo7PZjiQxj0n Y8kKbYx8DElyjiJbjnkXtWU4EBvgDdKKJzw6tZfBmIDjyqcjM5QokApgrUc9Ghm0RhEfCs0mKXHhq OwCrcVFJq+PQN24cHUqd4VUVp/OHMfkTKZohjrKPRq2ykTe3bcdRPcoy9XyjQp71z1YRPRNcXyu6r hC62+A4Q==; Received: by zero.zsh.org with local id 1phuJ0-000K4v-2i; Thu, 30 Mar 2023 15:35:14 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pj1-f52.google.com) smtp.remote-ip=209.85.216.52; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pj1-f52.google.com ([209.85.216.52]:41613) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1phuIR-000JMN-Cy; Thu, 30 Mar 2023 15:34:39 +0000 Received: by mail-pj1-f52.google.com with SMTP id fy10-20020a17090b020a00b0023b4bcf0727so20054820pjb.0; Thu, 30 Mar 2023 08:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680190478; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wXCkIq+5UACmIYPFfvPed5iqR+jDE+ePBLXBxpWuZto=; b=Gge5QTWQwRRdXK+jGOa1R937Yy1ZHuTVkogQIZ32+HL2b54Pnusfk+fF68TIaSHCe4 fJ9UgD/lYszCs5y8olhVeqMOveMwbSPebcrVSeHcyUl4xE15tVKSGSyTmPsRR1i3IrU1 5dd/6buGyHP7IkGgEBtRh+3fdkUWOksOdZvmrhs9HXIw9VAig2gpQU/h4Y6hVT8zVA37 K9k30iNNEGa4qORxXQ2bvvQC9Y0qMBiXuu1ohnlt1tXTfEXEaCO+B/LLlSmZfcS7bNKz 1It8ojhN7WwgbrMPhpcLqmizbGG06qTWzXJdJ0VfNW25371nOqw4TS/dpMN0yiIkX5WB rJug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680190478; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wXCkIq+5UACmIYPFfvPed5iqR+jDE+ePBLXBxpWuZto=; b=SziUVpqcjW8Ixk/IolAd1ZON8vboh3qBPbCdjT3KG+9dgkPNRCKnuRedhXTyJ+H7Mk YonrZpOxQjGZDY2Rwr/oR5BKpd9tstlHej1LHONaLAzpCdgkT22cEwAC0xsZwQHDB5uJ OGKjQ0auYagh9g/zEmaMqUhK7giWUNyQyFo7w6oKNOY9JqdTgQhnfVzVYuJoiDVYYZzJ MHiBmIeaHwE5ookK92nWSkzgH0pzdqHAXRIKg1FBN6heSrXjsb/MsTXNsHje5MrJwKhd DvQo+C0Ov7KSJaw0ak0JEBQNTJTOcB05YcxeeXE1dKtbDxrlJcj0BhLC9pfF2QGRvbFC 5hyA== X-Gm-Message-State: AAQBX9eQuPJEZtIeZK32clf2DvCUd6h407x9ZjD3BtF7aOV4dzfkOjde yBdEy34UOiRVCLWBXm3JPr6GBpvfS5Ym9VZJcNvQ5Rwg8ow= X-Google-Smtp-Source: AKy350bN9V4O/n5fxTP9FB/DtSFByLXa+A/86ojJqHqv8CTy9SzgovGZzoqdwN0T8xUj3tXAGr7ONvilwXASpQEbduw= X-Received: by 2002:a17:902:e88e:b0:1a0:7630:8ef9 with SMTP id w14-20020a170902e88e00b001a076308ef9mr9150653plg.12.1680190478124; Thu, 30 Mar 2023 08:34:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Felipe Contreras Date: Thu, 30 Mar 2023 09:34:25 -0600 Message-ID: Subject: Re: Discrepancy in IFS handling (zsh is *not* POSIX compliant) To: Bart Schaefer Cc: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= , Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29002 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: On Thu, Mar 30, 2023 at 8:58=E2=80=AFAM Bart Schaefer wrote: > > This has been discussed before, e.g. workers/48498 about 2 years ago. > There are even xfail tests in E03posix.ztst making note of it, added > in workers/48560. OK. But I don't see much of a conclusion. Do you believe POSIX says these should be two fields? IFS=3D: str=3D"a:b:" POSIX does say the delimiter shall be considered a field terminator, but str=3D"a" has no field terminator, does that mean there's no valid field? I understand from the point of view of processing strings in a language like C it makes sense to consider an unterminated field valid, but that's an assumption, POSIX doesn't specify that. It could be considered that "return 0" is not a valid field (if it doesn't end in a semicolon). Or, one could assume POSIX meant in the case of str=3D"a" the end of string shall be considered an implicit terminator, but in that case "a:b:" would have three fields, therefore making the terminators identical to separators. In which case zsh is actually compatible with POSIX. So the options are: 1. zsh is compatible with POSIX 2. bash and other shells are compatible with POSIX 3. All are compatible since POSIX isn't clear If POSIX isn't clear, then there's not much reason to implement behavior just because other shells do it. But if you believe POSIX is clear that the behavior of other shells is the correct one, then it might make sense to implement it in sh mode. Cheers. --=20 Felipe Contreras