From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Collin Funk Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 27 Jun 2025 05:37:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 78910@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175100260932179 (code B ref -1); Fri, 27 Jun 2025 05:37:03 +0000 Received: (at submit) by debbugs.gnu.org; 27 Jun 2025 05:36:49 +0000 Received: from localhost ([127.0.0.1]:58778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uV1lY-0008Mw-Q7 for submit@debbugs.gnu.org; Fri, 27 Jun 2025 01:36:49 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34180) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uV1lV-0008Lz-Pf for submit@debbugs.gnu.org; Fri, 27 Jun 2025 01:36:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uV1lP-0004YK-Jv for bug-coreutils@gnu.org; Fri, 27 Jun 2025 01:36:39 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uV1lN-0000mJ-TG for bug-coreutils@gnu.org; Fri, 27 Jun 2025 01:36:39 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-73c17c770a7so2095814b3a.2 for ; Thu, 26 Jun 2025 22:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751002594; x=1751607394; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=Wvi6j9tzIQuM1AoKncoWWMc+UlOy6/jVksHyPhOvuKY=; b=FzgX8SN0WfT6dmIqw18PEXQ7mzFGNU3QdOdpmyh6Tgs7IE/eA3x3LKETKWz1q7Zwsd emRgTMslihu0JW/FGqTyylo21rDmdCdGqIiCSHmz+pq+UOTlBvLA1TLIdxsy0DYvA6+u kbTw9x8NYknR5MJq/l5Uq1lzjPZ8rK4RudIkSK71nahfeksGU2Iggs8+5j08KCfN2MX6 m6pCU1dOpxEbH2nF9p0KT3mQKUsP3EHANGVA3mgfAFucCL2e4rJsNOCjq0WK7ajwhkAR 9LyL8AogQOXU7wFLkQwW8RF6vrJyuxg7SSE2ifPDdUU3Q5VJcnCBHB1yhpLYerjuAsSM DwOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751002594; x=1751607394; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wvi6j9tzIQuM1AoKncoWWMc+UlOy6/jVksHyPhOvuKY=; b=T7zt+5zC3+5kLKoa9MgJxCggCkMGXhP+aiYRSuE754BFw9svcaeea6kZ8z58OGoFzj TtSOyILiuDYPKPhCw83e5S71UnC04LPXwmpHuMxDv0YHo1ev5mUcr+xj+1auTBqMAzGp 9l+9U/gfkyG5Kd+QcGlwYw6NHobNs+7n5FbzUbxXwHATnl+8wiWss6iqY//R5E82+WCo SX38fh+bsKbAIdCjUosdwHuX+pWEVYyxgcwfa5Y/fZkn5Sc7ttOTlY2FKZyCk8C2nJ2t go2BaxRAsM8i/sSJe0r1QW3ifanswgjPS2p7uTLAMulA1GLveTvSRJwVnbrURpQ4UOAe 15Rg== X-Gm-Message-State: AOJu0YyiZ1RZfMIUFURLRKhbPBtlIn2A8sMgJ/0oWrjFtwumm+1e5dkW u0QR179QDY1hQwJ+u45tPk4X0I/zIJ2F7xL3J0Ffc0e+vtwmoZcRl/c8u5t+KQ== X-Gm-Gg: ASbGncunTqoiraHMFRW5YssqRGghm5au6KTJAfLoX4b+Wo2VBDOkG4IZrD3vqFj/C2K bC8pRYadh7mMoe2qN7xyehClIGYB9cTtsf3Ea/oZ8GbWm/JoPcVoeseEmv68gzSidjd5/ZOm7rt sNAHur4MotXvCJGGGYW/JoCqpTNOT6k5KkhFSgBdPQqWWNujkwIey2141b+8vkaa/QLOK1KqyqV tOQu7/yUg6CQB4ttCWFAUoBTSNnPeY02vDZa8TWMrtkqjIu96JHFqXijyV37Pt+Z2BHIJ2Hn/W0 frqBN94wq3M3EuWnXVDJi04WObscCF62iW7TEmq2jFc= X-Google-Smtp-Source: AGHT+IE9rEbtOGhObAc4WCanMx3zRBHZTNz0f4hEEm1Ugrv1Zeyk3VAknSTR0UEug0B16+JFUnCn2w== X-Received: by 2002:a05:6a00:21c9:b0:740:9d7c:8f5c with SMTP id d2e1a72fcca58-74af6f4cfa2mr2953147b3a.18.1751002594399; Thu, 26 Jun 2025 22:36:34 -0700 (PDT) Received: from fedora ([2601:646:8081:3770::6f5a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74af5573e49sm1370281b3a.77.2025.06.26.22.36.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jun 2025 22:36:34 -0700 (PDT) From: Collin Funk Date: Thu, 26 Jun 2025 22:36:32 -0700 Message-ID: <87frfloie7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=collin.funk1@gmail.com; helo=mail-pf1-x42b.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Creating this bug report since I have not been able to create a working implementation yet, and perhaps my looking into this will inspire others thoughts... POSIX-1.2024 adds the following SYNOPSIS for 'tail' [1]: Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (collin.funk1[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (collin.funk1[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Creating this bug report since I have not been able to create a working implementation yet, and perhaps my looking into this will inspire others thoughts... POSIX-1.2024 adds the following SYNOPSIS for 'tail' [1]: tail [-f] [-c number|-n number] [file] tail -r [-n number] [file] Where the description for '-r' is: Copy the lines in reverse order (last line first). If -n is specified, that many lines of the file, starting with the last line, shall be copied. If -n is not specified, every line of the input file shall be copied. In a simple implementation of 'tail', one that allocates an array to store each line in memory, this would be easy to implement. However, the Coreutils version reads the file in BUFSIZE/getpagesize() chunks and then prints, repeating until completed. Therefore, we cannot just modify the existing code to swap lines in memory. Collin [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tail.html From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 27 Jun 2025 09:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Collin Funk , 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175101543824878 (code B ref 78910); Fri, 27 Jun 2025 09:11:02 +0000 Received: (at 78910) by debbugs.gnu.org; 27 Jun 2025 09:10:38 +0000 Received: from localhost ([127.0.0.1]:33053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uV56T-0006Sr-2e for submit@debbugs.gnu.org; Fri, 27 Jun 2025 05:10:37 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:46567) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uV56N-0006Qq-A2 for 78910@debbugs.gnu.org; Fri, 27 Jun 2025 05:10:32 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-453749af004so10617635e9.1 for <78910@debbugs.gnu.org>; Fri, 27 Jun 2025 02:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751015423; x=1751620223; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=jearvyeMN3G4cqTyFSOa+0GvwRsxwVXKU1CC9f4d+yA=; b=nCdhd0RnSyYX+znn341Y5pNTD705EONRBDNGnJ3kjlIyM+yn+BYSqFcT98ojRUBe9x AG0yPyIXb3cz1MeUY4cbfoe/U5s08zawyUKs+2UWCYNksjZqZTDhCjpfaXQ9DvknDHVo 4Wiax6qE/hkV6NpnX3Zb1+blMa4frfttEfXm5/K8MlLpLqprVeqJnsYHSk1CK1XvoHzY 5U5Zqj8VNOf6D0Lcp6b0tNPz5nZ0lBgbU69Kv4dqWURavlxTGVbGsRFP74ooarO09NOW cTD+4eVuNwTQVPvwQ2NFxlQ7mmR+ltuDLcx2uEBvQ6dQliK5xHLcvjfWQOZplsrajRs4 9quw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751015423; x=1751620223; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jearvyeMN3G4cqTyFSOa+0GvwRsxwVXKU1CC9f4d+yA=; b=wu7ccsfu+1GQJOW4sFjrAh3JoCO6EFRYtRrjA0zoAvrHoR4IZQRiKdQXw8DimAfePI UItsvqIUvg/CGAUSm4yxSSZHeFrTJW4otqRXCuQQqRp23HkDLXmOGx/E1v7dGmJjKO14 qKybfhmqRet+F3hW/68qB1TT3OiqJufD17wL5leHNld9HAMFQq18HzlmmZH5dllmYbWZ e8T3WzGW4Z+ZURIHeH02K8pwHLhLsbnAeX6t2QmrYdhMSCOYpvPtlG4Hzggu/YCiXZbv /aXW41Eou9TpXWQBe4jYO43TRwrRam6Nlr5dcSeaUWhmmBBiR9ilcwJv81sa6I/jyV9T 6EAA== X-Forwarded-Encrypted: i=1; AJvYcCURXZZDQLE9Q3kUJ1r8mB8KJ1iGVFL4VpiKUJfAAXxj9snYtuGCKVLgmdLYHeTd5RKB/kojsw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx+UhMiAfhRkgI3HZf7X4RRVLXhI5LhP17iMHRlZ/tEyaSggkTQ wU5DJybEcwZqmz5A/6hAN1fHSpMSasrKcuZexVvd9m6BlSPxB6mV6qqm X-Gm-Gg: ASbGncteSs69qj2hb05cPPrDXoFolkWoowODDU0jmrPX69LAbcMBJcjQT/XxJVOoYsY Ot7U6Ar9rc3uLwpDlGJsp1ZNvTnskAClyGuZri3J+tGny/9slSX2QgIl91UrmrUw8nqry/0cjHl A3XopyPeUcxcF9jDCeKY9JLJxiic6C/hOKziooodXIWMjLPzxnYT2ndjxNoT8gYEFQ+/RzlOdZl NxicGjumYTq6FYRus/ZsOJ2mLYxuzZ1wPGlKOuMu5xoSC8gEoAqUBLEtrFn5rjf9vFC6ETjdxxo ZXbI0Gn49kXdE9q2MTaHob1xqaOc3ZxbL97Yn+/zARxpvxWJ7GlwIlkF4WDzyYXHWPn9BolTmpb fYvraHmkD6TrTxQMnXRVySk3DkuNOUmI6gt6uoS7bCA== X-Google-Smtp-Source: AGHT+IH4DCytvGPCh3QMagFaBRA8I6PBPqfnMIPDhi0K6xDxn7k5cC4ycTDt8buqXv/cyEIVchDwGA== X-Received: by 2002:a05:600c:3ba0:b0:453:608:a18b with SMTP id 5b1f17b1804b1-45391b6ca04mr9868495e9.9.1751015422539; Fri, 27 Jun 2025 02:10:22 -0700 (PDT) Received: from [192.168.1.31] (86-44-211-146-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.146]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4538234b1b9sm73278635e9.11.2025.06.27.02.10.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Jun 2025 02:10:22 -0700 (PDT) Message-ID: <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> Date: Fri, 27 Jun 2025 10:10:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta References: <87frfloie7.fsf@gmail.com> Content-Language: en-US From: =?UTF-8?Q?P=C3=A1draig?= Brady In-Reply-To: <87frfloie7.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 27/06/2025 06:36, Collin Funk wrote: > Creating this bug report since I have not been able to create a working > implementation yet, and perhaps my looking into this will inspire others > thoughts... > > POSIX-1.2024 adds the following SYNOPSIS for 'tail' [1]: > > tail [-f] [-c number|-n number] [file] > tail -r [-n number] [file] > > Where the description for '-r' is: > > Copy the lines in reverse order (last line first). If -n is > specified, that many lines of the file, starting with the last line, > shall be copied. If -n is not specified, every line of the input > file shall be copied. > > In a simple implementation of 'tail', one that allocates an array to > store each line in memory, this would be easy to implement. However, > the Coreutils version reads the file in BUFSIZE/getpagesize() chunks > and then prints, repeating until completed. Therefore, we cannot just > modify the existing code to swap lines in memory. > > Collin > > [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tail.html tail -r comes from the BSDs. Also the BSDs don't have tac(1) which overlaps in functionality quite a bit. I'm a bit surprised -r was added by POSIX, but fair enough. Thanks for flagging this. Padraig From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 27 Jun 2025 09:32:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.17510166813469 (code B ref 78910); Fri, 27 Jun 2025 09:32:04 +0000 Received: (at 78910) by debbugs.gnu.org; 27 Jun 2025 09:31:21 +0000 Received: from localhost ([127.0.0.1]:33326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uV5QW-0000tk-BG for submit@debbugs.gnu.org; Fri, 27 Jun 2025 05:31:21 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:58371) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uV5QR-0000sT-HJ for 78910@debbugs.gnu.org; Fri, 27 Jun 2025 05:31:16 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3a53359dea5so1199222f8f.0 for <78910@debbugs.gnu.org>; Fri, 27 Jun 2025 02:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751016669; x=1751621469; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:sender:from :to:cc:subject:date:message-id:reply-to; bh=i4OaYBt7Q6PjASSF48b08UMi+XXRr1R2iMglupoaD0I=; b=SvqgAYVGYUw/k/CnDE4ASPyjZH1gChP65P53Q0QK7PHOl0831WX9a2WwZFzLjayVr2 6Yhlrnl8advXoC+l9XgqDj7wbxdZoCWe9oDHqYIo18E6lapKBQvddrmlztacJvVM3ZO0 f6gym9/Nc5F4rG6l818kU2qluDmGFJOz+ft778heTnHMvkDjFQ/axVm+ODrLOdsZRD6i 5dcyFHy/J6VhCirmgExy7O9myoVxwcmMEwZEYr/Ty833gkk/cxWb1RgxJ9UPJWV6ta5W 8gavX4MvSG0o2Teb3bz+jPh7vgIxPYPXC6JBg0puMOFlPqMbb4qXUOM6nRVP0x66Vd/c NoDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751016669; x=1751621469; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=i4OaYBt7Q6PjASSF48b08UMi+XXRr1R2iMglupoaD0I=; b=IaLsGq7xkA9O4SdzXG4Pn4N5GRaChRfwAmGy6M10tqXpOsYvqcm0zS8ti5/w6g+N9c 6WSZkGadkGstAXkSeh/PFTtC/8wktw6H9NZ7JZyLUZfGvCkpaBDHsl2BWFG3UOmMS3mu kXKU6S7iGnK2DQY6nzJ8TeZtfdBwtaINXSowcC1F8pmQ+EmKOIvoZaH6aoPiHWvWpBof 3jdQYGdjvqA52sfR0ZINScSBRLWnh1u8xVSKg2xw/H5pCziHyKU4PxeYen/j+MS7GnL6 18Xtpw0r2VAmWpKZvKgQYkZs70uqBKGOEs8cIwmn7o4KKeofOn+f4or4E6STtODgINFE P/RA== X-Gm-Message-State: AOJu0YyQd7jCY7EdMsHvyw8ds4UI162rcUogQ7gJNe3tWQErtI+bzb25 CQ4VJ65RGYdw73jPHEjbbp8Rouy7F5QUCfd74SRcIcho9wsYQ+vSICBkvpVnsw== X-Gm-Gg: ASbGncuPmdiT5RnvdTUjLJB1FGKf0SJu1WwtRF1PCBSC4FX3YosWJ/As2qjegZa3uwf Dy08Ur7eojDzpwf6C+D7bRK4luCZa0MbYvDKitH3yxxTvu0GEatDmOEMDs5NGDPMJVKDSrhE6Zo Qy2U+YAmrqiJnaUna5Rb2vvB5+CkaKLyn1uegpKIt3lqtlBBQvGmfiVUc9cPi/6lfCpgZlm2qm/ 9gXNvlo7+tdmDKGyZ2cTsALbHl1+ZFWKfNPOcqkg2rIJ96eyPgjhsvMoPQnBCMQ2eBa+0TVxmmL HTVKTzpDICW++r31Yd1v21vUjjVIJBywhaZwGWKUC8JKo0CIZTJWNCH9ZpeDL8LvkXZatEAGcOC VxC+j6+y99avUuFlX2kq3w5MfegjsimTz3/sMWam5wXABcgJeHWE0 X-Google-Smtp-Source: AGHT+IECm0MPxU9gdYA9OaeQsNGjBCOBb2t/RCS8+hqttwffzeP4n02MLmwTEOTABzjESBjSgHorjA== X-Received: by 2002:a5d:64e1:0:b0:3a6:d579:ec21 with SMTP id ffacd0b85a97d-3a8f577fd35mr2248550f8f.12.1751016668560; Fri, 27 Jun 2025 02:31:08 -0700 (PDT) Received: from [192.168.1.31] (86-44-211-146-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.146]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3a88c7fab15sm2233531f8f.33.2025.06.27.02.31.07 for <78910@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Jun 2025 02:31:08 -0700 (PDT) Message-ID: Date: Fri, 27 Jun 2025 10:31:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta From: =?UTF-8?Q?P=C3=A1draig?= Brady References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> Content-Language: en-US In-Reply-To: <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 27/06/2025 10:10, Pádraig Brady wrote: > On 27/06/2025 06:36, Collin Funk wrote: >> Creating this bug report since I have not been able to create a working >> implementation yet, and perhaps my looking into this will inspire others >> thoughts... >> >> POSIX-1.2024 adds the following SYNOPSIS for 'tail' [1]: >> >> tail [-f] [-c number|-n number] [file] >> tail -r [-n number] [file] >> >> Where the description for '-r' is: >> >> Copy the lines in reverse order (last line first). If -n is >> specified, that many lines of the file, starting with the last line, >> shall be copied. If -n is not specified, every line of the input >> file shall be copied. >> >> In a simple implementation of 'tail', one that allocates an array to >> store each line in memory, this would be easy to implement. However, >> the Coreutils version reads the file in BUFSIZE/getpagesize() chunks >> and then prints, repeating until completed. Therefore, we cannot just >> modify the existing code to swap lines in memory. >> >> Collin >> >> [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tail.html > > tail -r comes from the BSDs. > Also the BSDs don't have tac(1) which overlaps in functionality quite a bit. > I'm a bit surprised -r was added by POSIX, but fair enough. > > Thanks for flagging this. Note the GNU info doc on tail says: "GNU ‘tail’ can output any amount of data (some other versions of ‘tail’ cannot). It also has no ‘-r’ option (print in reverse), sincereversing a file is really a different job from printing the end of a file; BSD ‘tail’ (which is the one with ‘-r’) can only reverse files that are at most as large as its buffer, which is typically 32 KiB. A more reliable and versatile way to reverse files is the GNU ‘tac’ command. " BTW the POSIX tracker on this is: https://www.austingroupbugs.net/view.php?id=877 cheers, Padraig From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Jim Meyering Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 27 Jun 2025 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: Eric Blake , 78910@debbugs.gnu.org, Collin Funk Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175103949416281 (code B ref 78910); Fri, 27 Jun 2025 15:52:02 +0000 Received: (at 78910) by debbugs.gnu.org; 27 Jun 2025 15:51:34 +0000 Received: from localhost ([127.0.0.1]:38844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uVBMT-0004ET-Op for submit@debbugs.gnu.org; Fri, 27 Jun 2025 11:51:34 -0400 Received: from mail-pg1-f172.google.com ([209.85.215.172]:44149) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uVBMO-0004DG-Td for 78910@debbugs.gnu.org; Fri, 27 Jun 2025 11:51:29 -0400 Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-b2c2c762a89so2151474a12.0 for <78910@debbugs.gnu.org>; Fri, 27 Jun 2025 08:51:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751039482; x=1751644282; 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=kLZ+Z2tsH2yqF7FOpR8H0OTXYcrgBAJbgiewF+3q8w0=; b=qUuuoJjTdGIBIODe29zhglrjdKFoHnXBU3AjnTNAIQDDIbsUM0+mu0o7py+1/xbLK5 Jqk73BqiGeGu8BnFBhPt1sGZYkJ5rMeZR0hXYOs8kKNXN84un9/3FTL9DlXomqYEm+YY 0BmE8VuuRBy7z9bGozffRG6/ZXnA/JapM7RMVjDQTFNmiqBX+OOiV5o/r9sYlOoY5OQa 91jy/wGfJjWinylRsngDXKtdWEAxyITC2SYwUC44V0QJIsoC51Zcw2RrkcTthi1YpHHh hH0Z1x6C6nCH9khWGyXKJPfoAuryIlAo+aPTA36fiy6Cz9oKRg74IzuqG0djBiv1fUwb 63UA== X-Forwarded-Encrypted: i=1; AJvYcCWL72/ZJI2UJSEj3A902JkbgyIvkblcdu5/GyyAdoUAZkYKIW5tp/Cm1mnz41orV0DL0fNxsw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxs4khrMuvLdUfUVzKJG7rtNGcdQazxFdsU9HVUNcs+TDV5ZqpX IkG6uBFsZuNsmhX9bT2JUanlpXtynXUmzqwSaiRtiyV2MCjwjigJiqM/kgiUh22+F1Ojtlv+FNh M937hqltyQZa4Ffx7Vmkocao4vFASWeE= X-Gm-Gg: ASbGncumCCsDT2qiGPfqTJvzhUItVjsjGAVlP5g2YhKOywGL+078BI5M22dJgB6zpNH mOytxxjg17mki30o2CNIv06mQVrfWaSFTDfsZYd6kX8YV5GlefCzk3Ap80Tgdt36uUkRgKMpt8s oh6H2uTuFzJkPyzXXDY+wmfaiU/PZpzirF93ouSmLgUUGyiuFkhTU= X-Google-Smtp-Source: AGHT+IEnkZ/PweQhKIBHBsgz28fsXLLyXaUbHq/RvRDTsU0bpYuO96agy8LqXjZb25d25fXhfMHoevq+s+gSvXGE2WA= X-Received: by 2002:a17:90b:58ed:b0:312:e6f1:c05d with SMTP id 98e67ed59e1d1-318c8eb9aa8mr5831008a91.2.1751039482415; Fri, 27 Jun 2025 08:51:22 -0700 (PDT) MIME-Version: 1.0 References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> In-Reply-To: <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> From: Jim Meyering Date: Fri, 27 Jun 2025 08:51:10 -0700 X-Gm-Features: Ac12FXwdUyROCO_-9OLmasDJtAXMzHDQFYzm64NHVdh_M8lOhFOSmlK7U93gghk Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, Jun 27, 2025 at 2:16=E2=80=AFAM P=C3=A1draig Brady wrote: > On 27/06/2025 06:36, Collin Funk wrote: > > Creating this bug report since I have not been able to create a working > > implementation yet, and perhaps my looking into this will inspire other= s > > thoughts... > > > > POSIX-1.2024 adds the following SYNOPSIS for 'tail' [1]: > > > > tail [-f] [-c number|-n number] [file] > > tail -r [-n number] [file] > > > > Where the description for '-r' is: > > > > Copy the lines in reverse order (last line first). If -n is > > specified, that many lines of the file, starting with the last lin= e, > > shall be copied. If -n is not specified, every line of the input > > file shall be copied. > > > > In a simple implementation of 'tail', one that allocates an array to > > store each line in memory, this would be easy to implement. However, > > the Coreutils version reads the file in BUFSIZE/getpagesize() chunks > > and then prints, repeating until completed. Therefore, we cannot just > > modify the existing code to swap lines in memory. > > > > Collin > > > > [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tail.htm= l > > tail -r comes from the BSDs. > Also the BSDs don't have tac(1) which overlaps in functionality quite a b= it. > I'm a bit surprised -r was added by POSIX, but fair enough. "Surprised" is putting it lightly. I am disappointed and am tempted to push back and to delay encumbering GNU tail with -r. That is an option no GNU system needs, since they've all had tac since before 1992-era textutils. I've Cc'd Eric Blake, in case someone wants to propose adding tac to POSIX in spite of the fact that the BSDs still lack it. From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Collin Funk Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 27 Jun 2025 19:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Jim Meyering Cc: Eric Blake , =?UTF-8?Q?P=C3=A1draig?= Brady , 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.1751051808507 (code B ref 78910); Fri, 27 Jun 2025 19:17:01 +0000 Received: (at 78910) by debbugs.gnu.org; 27 Jun 2025 19:16:48 +0000 Received: from localhost ([127.0.0.1]:41637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uVEZ5-000081-KU for submit@debbugs.gnu.org; Fri, 27 Jun 2025 15:16:48 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:48241) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uVEZ2-00006T-ME for 78910@debbugs.gnu.org; Fri, 27 Jun 2025 15:16:45 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-74931666cbcso2822196b3a.0 for <78910@debbugs.gnu.org>; Fri, 27 Jun 2025 12:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751051798; x=1751656598; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dXy6dSn9AUYTgs4UiY7aEfHueUhtD6lrtLDBj19YCyM=; b=aDFFRoSYpJZ+j1769PCWIkIohqPRWiIzGJllC6bvYlYcKe9lUeKY/1CgCOrhF2vy2Y A9mdsJRXQGJqUpbwl1zvi91PMPov4CxFCNh+h7YwbMfO/9yWq6EuO/onwOd0Mr6+sCLX RdHzdlaUyRv/J2O23VhRmvxkpGOyuAE4G8CbIVCeET5u0k8iS3birOtVdV8VVATw9KVe TTKJt6NT0INbDtrgBfJ8InJcpjTwXwXjBbK/iaJejOl8QiCQeu5B8iketIP1PzfhN+Aa HX/kQmCXFlFogBkH8TkEs91YAPdq8UGfcC6eCa9pmTe3vzs+4f5L/oxOw7QQczZw7zsw 3mPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751051798; x=1751656598; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dXy6dSn9AUYTgs4UiY7aEfHueUhtD6lrtLDBj19YCyM=; b=UcdAv3JdyyLEcMHgd760GR0nAO1z3f9OZ09pMdDz0rUqAHFGFz4ADQ64IIEXVj6qlU tZIhDMx+6OS0c3cioCxsRXgWHZsIDmD6pNBWpJogf3rwDSqib5xgIYpKlV3MPsrX/rNe zpyBZVJEWu22uQZb0TBDKtzGYFWIkOFhSVeQMf8axgS29QrPTzmFY3ZIBMrqEEUBygbK UHFq7z3Gwa1aysOiRjszyt6mr/awUQPlGvP1GYa+gGZBZVBcrZkIiEwAwec6CPiEjzZW 4gTPqTiRQpvjUld9X4PPUZmXZUfYekQpNKVcYg7iZRlPWSrMiZZ8X+JRtqzNP4QM8flr 1CkA== X-Forwarded-Encrypted: i=1; AJvYcCXTZkatx+Y92EgmyE4t3xnm1JrIv+QrRkApRfzsiR6l0EClaB+BevwZwZvYxkNRRFHWnchy9Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwshAnz0uWP7LtZAMz0XdEJk7G76Ob58d/QQoSQaAUW3HmQ28VT qaOYAcF1HTKPIx4s5fmKuEGULdwb8ssl2RVJcoCOT4uYuiDDruwWc4VF X-Gm-Gg: ASbGncszKZ2WKM9BcVcC92iImSWhQOg/jkgeO4Rfd+LnO3halB29ujhJkoG3RcjARwa 9K8u1C7uv4UmtnbW5I46FpveEej+lBuIDwyF+4QayLB+nuJGt4vLBv9m0INdp2RhLG7MlQ+xnW5 Rxc6Ob/XV0+cyF3MRtXJuKeW8dVr81NLNy5fioMy5Id2atAcKs+la+xSaIxW2zCT8Wo6Pp4UfZE Xc9hwLj4bBvEAeorLDppdjv94UrzFKk24bNEAUQdD3894E8slzi5LYzpT6eR1ozPzBOVEOz9VtG /BgXVb72PoKyzIM+ZiF4fQPEnzWEAWeVBS4EZHhKM2U= X-Google-Smtp-Source: AGHT+IH/FvotoWPNLBHBnjCT4ryyOvO21qgH2aiHOHPLtecRa3C4bEopXSpTRSm7C5eJ2cC9+ofp0Q== X-Received: by 2002:a17:903:70c:b0:236:363e:55d with SMTP id d9443c01a7336-23ac462465amr55207505ad.28.1751051797937; Fri, 27 Jun 2025 12:16:37 -0700 (PDT) Received: from fedora ([2601:646:8081:3770::316a]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb3ad23csm21084015ad.145.2025.06.27.12.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jun 2025 12:16:37 -0700 (PDT) From: Collin Funk In-Reply-To: References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> Date: Fri, 27 Jun 2025 12:16:36 -0700 Message-ID: <874iw1t2p7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Jim and P=C3=A1draig, Jim Meyering writes: >> tail -r comes from the BSDs. >> Also the BSDs don't have tac(1) which overlaps in functionality quite a = bit. >> I'm a bit surprised -r was added by POSIX, but fair enough. > > "Surprised" is putting it lightly. I am disappointed and am tempted to > push back and to delay encumbering GNU tail with -r. > That is an option no GNU system needs, since they've all had tac since > before 1992-era textutils. > > I've Cc'd Eric Blake, in case someone wants to propose adding tac to > POSIX in spite of the fact that the BSDs still lack it. Thanks for reminding me about 'tac'. For some reason I forgot about it. That solves my question about how to implement 'tail -r' while avoiding arbitrary limits. But I agree that duplicating parts of 'tac' into 'tail' does not seem ideal. Collin From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 27 Jun 2025 22:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Collin Funk , Jim Meyering Cc: Eric Blake , 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175106290431385 (code B ref 78910); Fri, 27 Jun 2025 22:22:02 +0000 Received: (at 78910) by debbugs.gnu.org; 27 Jun 2025 22:21:44 +0000 Received: from localhost ([127.0.0.1]:44206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uVHS3-0008A9-NW for submit@debbugs.gnu.org; Fri, 27 Jun 2025 18:21:44 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:46278) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uVHS1-00089O-1l for 78910@debbugs.gnu.org; Fri, 27 Jun 2025 18:21:41 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-450cfb790f7so20894345e9.0 for <78910@debbugs.gnu.org>; Fri, 27 Jun 2025 15:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751062894; x=1751667694; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=3+VQxQWzLzuD3jYk0bvVhREwbt05iXkRnFAvhrU+IBg=; b=NxIFpKyW8/mUdREj00JMu9oH1jO02O5VVAFoXEvOvueuprZZG1aS5VRddc+wH5kGxt Xgfvd3uPkii5eDSzJzELb/A0w64N2Dt+DszEWubYjqhBWcR5jGkqnOUZErH+trGdKP6k rMgkHwNUAy+aBup0CCHch038Do5ZUAKUPMcrrSWMD5VJ3X/W2wGPQkdQw2PzfYKPKrfS yzpgh1K4Decv5O8dTukHeBnPqPvGvJINdoKPkRnC3+tC7fa/Z32uwrzrvMP4dr1xDTM1 aW8mOPn7cvKzx8PiNLjjcT4pdydXq4GC8CzjjZc9jpF9lsskl/1sgwwnWxxz/IzkHK+7 sfJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751062894; x=1751667694; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3+VQxQWzLzuD3jYk0bvVhREwbt05iXkRnFAvhrU+IBg=; b=mvjq97T+G1phGzOL4wdmNtGdaBTO6y6U2DRx3bRj8bMNoOcJLYEnHiFvHrkhYCvMhE CdJz9gW3MJlP+z2frwtOy5dtsTDtsgNMa54trTnxPj7l0U9O9zlBY8kfNDM1qdN49KeE M0lWknkCs7dOEi+O7ujaceWIidu91l2+blz8Tfbrs34nDC2WteLbAgvlDIzAmkvZPpvp 24IPwBxClqUDpj9l5+PtgZQs45lRkdMJTa1TzUaaELH+1ylQ5rNj1M1F5gUOqwsfeMXo yyFzwXmOpW0/rySMPlrOtRf7Qwv/1tmfoyPXaJusnI624VndIvt3Gugub4EuVd5B37du MERQ== X-Gm-Message-State: AOJu0YxX3Q+TegUF+OfERY495nFO3JX965wuEXGeoahx6rd3MfVZb5/a /vNqxLq5MHaaemMDAbmOLcYgMBNPXHBmKr+xV7N8jQ/T2oBuxmGGFbY5 X-Gm-Gg: ASbGncuV5Ct2m0qfftgNLFIzDgNl5ut4c2+ZFK42rAdTE95dUISa7mpbt90qikSi8L+ j+Hv5gDV3qAxke2EVNCLhQ0qoMaSJheIpesOQycRV78Z2drbibkHuT+HPqs2GWge7v8F6MnP9is lup8OcIBMPEEajjb/vCvdyn+LPOgefxsnVfLDQ96NV5pIx/8jwbROjwz6BTDey7P9y3MQO0iwCG z4cs7tg4YH7cCFZdTTMChxFAJ43LvsHz+sROg0/QrliLILBwYVWmfUcssoauu+PIZrEXn/ElB3L K9hCtp+ie4codHQIgEgF0TnJmqH1mDGyffFbc+u8mxpGjFOuhxAYqCvGXqx4B5ANCRmmQ7nU77B h3zLOWPMKmBoO2/d1ot3rFfukH4w8nYp7F2pnGyxszw== X-Google-Smtp-Source: AGHT+IEhPAmvs+P+tto605nvnT0/DjPBHxrRpRBmsydz3/sv+WWSr2jsSzxv0GmlydewLwo2t/Krgg== X-Received: by 2002:a05:600c:8b28:b0:453:8bc7:5cbb with SMTP id 5b1f17b1804b1-4538ee5cefcmr48566945e9.25.1751062893579; Fri, 27 Jun 2025 15:21:33 -0700 (PDT) Received: from [192.168.1.31] (86-44-211-146-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.146]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4538a3fe0efsm61572025e9.24.2025.06.27.15.21.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Jun 2025 15:21:32 -0700 (PDT) Message-ID: <19ab8f45-d39c-499a-930b-9b52f5f758f7@draigBrady.com> Date: Fri, 27 Jun 2025 23:21:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> <874iw1t2p7.fsf@gmail.com> Content-Language: en-US From: =?UTF-8?Q?P=C3=A1draig?= Brady In-Reply-To: <874iw1t2p7.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 27/06/2025 20:16, Collin Funk wrote: > Hi Jim and Pádraig, > > Jim Meyering writes: > >>> tail -r comes from the BSDs. >>> Also the BSDs don't have tac(1) which overlaps in functionality quite a bit. >>> I'm a bit surprised -r was added by POSIX, but fair enough. >> >> "Surprised" is putting it lightly. I am disappointed and am tempted to >> push back and to delay encumbering GNU tail with -r. >> That is an option no GNU system needs, since they've all had tac since >> before 1992-era textutils. >> >> I've Cc'd Eric Blake, in case someone wants to propose adding tac to >> POSIX in spite of the fact that the BSDs still lack it. > > Thanks for reminding me about 'tac'. For some reason I forgot about it. > > That solves my question about how to implement 'tail -r' while avoiding > arbitrary limits. But I agree that duplicating parts of 'tac' into > 'tail' does not seem ideal. Yes not ideal. I wouldn't be rushing to implement it TBH. Note the POSIX specified functionality is limited to -n and a single file, so we might be able to implement the POSIX subset by just piping the output (of one file) to tac internally? BSD functionality is more involved: $ seq 10 > a; cp a b $ tail -n2 -r a b ==> a <== 10 9 ==> b <== 10 9 cheers, Pádraig From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Collin Funk Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 27 Jun 2025 22:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: Eric Blake , Jim Meyering , 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175106414910242 (code B ref 78910); Fri, 27 Jun 2025 22:43:01 +0000 Received: (at 78910) by debbugs.gnu.org; 27 Jun 2025 22:42:29 +0000 Received: from localhost ([127.0.0.1]:44396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uVHm5-0002eu-Mg for submit@debbugs.gnu.org; Fri, 27 Jun 2025 18:42:29 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:44128) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uVHm3-0002dv-8e for 78910@debbugs.gnu.org; Fri, 27 Jun 2025 18:42:24 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-749068b9b63so2265326b3a.0 for <78910@debbugs.gnu.org>; Fri, 27 Jun 2025 15:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751064137; x=1751668937; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lJUKxWuy7BE02hGoV+mYFfjBGf4W6KQ4rTdR4p29kjI=; b=j2/kCUV7gXq4Esxlzfh4jDclt1EwJkeahb92FRrgEmfU7Ceh9jUE3NdCv9sTxCGAeS Rm3W8e1j7SsgducmCfNyFwgw3CV8Ky6uq6t0LypspwtEvW7SSdCrGnoaZbYcvs0XjlI7 H9xIYUl1ozCDhZiACcePRdd5MPZN91NrwHwBNIx1PYPmAyMd7BgaesvBRHjnz6Vxzp7g YOTK0I0Yo//MqZQdBXlDukFS7aYbPsfs0X8Jwd39SEkdLnvWkZTrBSI6XCembDZgiAC9 KbizS7nYcmRt42bKprtbxP2gGrVHb+TOiQEaVqbZQBFoOlG11THpCxFwdtaFMb/OE9qc K99w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751064137; x=1751668937; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lJUKxWuy7BE02hGoV+mYFfjBGf4W6KQ4rTdR4p29kjI=; b=lPLgEVSbz8i8nJOQ+tQBuAiLW7BJ7GLmMaY4p4iWCTkbVkZMIXvTTILxJj+gp3f/0v vgZEhDgpwyEp3+L8G71WG6yJlBNJ7vWctbUqTOW+XaeAzbTyhCyvkSjBEK7cVTK5ROaP vIGcjM+rVqCeJx8vfHQk/Z4ltMfAvapmChFTcYvgDtNTmnJAcj3G4C1p7IELTP+6hXWj Y0l52dtzzzS4Lo8ZxDv9VJPcyoT1msPPgHDv5CWsQp0fXxoNT9UbDQsfAqbdLdV/SALK U5aSuCvXt+rOzVRvqcBlqagpjVf6PmcfUtVCxImgoJa2vN8CtTMICDkKo0XoITjI9vwD 0aGw== X-Forwarded-Encrypted: i=1; AJvYcCWsCo+OVzfM703hjhAr75oS+/TI7D0dpEzxALwr+9bOGI30tsuPO9LOkrWaNxBVw9yRcoQyKg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxUfxxZ8L9uCH0+YqNMgLlnQGdJpnXgnQc8rdsUvVdMYcXFuAx3 0tu9Z32D9tEn1BPOfJU/MRy6225cem9LfdtBFl5CDCHNkwg5hn0HSJmc X-Gm-Gg: ASbGncuBDf9u1K/buI1xrrtH3APgLFgs1W5Sx+sb29igGW0pO9ODFXReBPJufV2xFRQ 6A8sJmIwXpt8E6UfE66oMtBQeuC44KXvXs+vHAofuayhekkE5chN0mjHBS4RPnYnysvg3KNxcXx det53JUOJOFBDncwixlbzxai4XT9yv1gM7+zFlusZ7nsYBLv85Z6/RRAaoeckbGZMvXpQqwYDiL Zm7CgjSPNf101uzXXfRTnrdk56nIV9xt6jb917zTcxLgP/t6p3b5URrznPX/+r9hPWywI1wDSJA pLlqO9/RhdQnfdC07lPCjZ99MwOwev5+qN5NdrZBsZE= X-Google-Smtp-Source: AGHT+IFXfQpzkNjDb8qd4LxB8S7hHF5zblhNmJxWq/wQuqJxchVp/4v8yThVUtkJ02Vh1vnMwydkVA== X-Received: by 2002:a05:6a00:1954:b0:748:e149:fa89 with SMTP id d2e1a72fcca58-74af6e8f5d5mr7311806b3a.8.1751064136937; Fri, 27 Jun 2025 15:42:16 -0700 (PDT) Received: from fedora ([2601:646:8081:3770::316a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74af540ae59sm2957371b3a.1.2025.06.27.15.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jun 2025 15:42:16 -0700 (PDT) From: Collin Funk In-Reply-To: <19ab8f45-d39c-499a-930b-9b52f5f758f7@draigBrady.com> References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> <874iw1t2p7.fsf@gmail.com> <19ab8f45-d39c-499a-930b-9b52f5f758f7@draigBrady.com> Date: Fri, 27 Jun 2025 15:42:15 -0700 Message-ID: <87wm8wst6g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) P=C3=A1draig Brady writes: > On 27/06/2025 20:16, Collin Funk wrote: >> Hi Jim and P=C3=A1draig, >> Jim Meyering writes: >>=20 >>>> tail -r comes from the BSDs. >>>> Also the BSDs don't have tac(1) which overlaps in functionality quite = a bit. >>>> I'm a bit surprised -r was added by POSIX, but fair enough. >>> >>> "Surprised" is putting it lightly. I am disappointed and am tempted to >>> push back and to delay encumbering GNU tail with -r. >>> That is an option no GNU system needs, since they've all had tac since >>> before 1992-era textutils. >>> >>> I've Cc'd Eric Blake, in case someone wants to propose adding tac to >>> POSIX in spite of the fact that the BSDs still lack it. >> Thanks for reminding me about 'tac'. For some reason I forgot about >> it. >> That solves my question about how to implement 'tail -r' while >> avoiding >> arbitrary limits. But I agree that duplicating parts of 'tac' into >> 'tail' does not seem ideal. > > Yes not ideal. > > I wouldn't be rushing to implement it TBH. I didn't get far in implementing it. So I am not in any rush. > Note the POSIX specified functionality is > limited to -n and a single file, > so we might be able to implement the POSIX subset > by just piping the output (of one file) to tac internally? This would probably require adding a '--tac-program=3D' option to tail in order to handle './configure --program-(prefix|suffix|transform-name)=3D' before and after install. See a similar fix I did for diffutils a while ago [1]. In that case '--diff-program=3D' was already supported so no big deal. But I don't really want to add '--tac-program=3D'. Seems a bit awkward to me. Collin [1] https://lists.gnu.org/archive/html/bug-diffutils/2024-06/msg00016.html From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 References: <87frfloie7.fsf@gmail.com> In-Reply-To: <87frfloie7.fsf@gmail.com> Resent-From: Bruno Haible Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 29 Jun 2025 23:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175124054017442 (code B ref 78910); Sun, 29 Jun 2025 23:43:02 +0000 Received: (at 78910) by debbugs.gnu.org; 29 Jun 2025 23:42:20 +0000 Received: from localhost ([127.0.0.1]:33023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uW1fA-0004XF-H0 for submit@debbugs.gnu.org; Sun, 29 Jun 2025 19:42:20 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.221]:44353) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uW1f8-0004X2-A6 for 78910@debbugs.gnu.org; Sun, 29 Jun 2025 19:42:19 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1751240536; cv=none; d=strato.com; s=strato-dkim-0002; b=gLQ+krVKNp2O9g44yMEhW98/75sijJviIIgshl2CU2r8waTMEeVme5DO42h9WGheQR qcDLP2p9r0N13Kuq4RtpT95kZNrNxAnL5a78kocaw9wb6ajfY1xZTgry5N08TGuCpKA3 /2MGvos/2Vajzbbq6E+8LA64v57uT4XBR4R2Cwk7+xpy/4ZrRRA50LY9oGWSnb5UzaPM RgZcShuci+xhY9ZzO2XI1IfAZwCBxZsmvDijzuV9LCnQz0/3O9CcQHkBuL3n4NwEGICM OA/xZ3tWf6kg/M8B7jxt6eCkbfDKtg3HDkvrWHmcfK0qZO20DR6IDFKyOs06ZJ9ZvyHm gesQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1751240536; s=strato-dkim-0002; d=strato.com; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=sD1mOg8Vxy8m/AoFo9x4hrCmUs/Um6eC9pUdFjLqKMY=; b=gbYayQABHRAEd4TtC3OZz+5mzpIscgEefh76G1Q9EipBVv/FGKk0NJ8st2onCgD7uX oYilur0m7XrBkcm/MWZ7MQzsvFxFNVqvFUgeK1cN3Hjm/NIkcqPC1te8ONPk9RnxxGgM WvtqyHNtdNua8QthagtnC2pOpL08/hj8jJ5uMKPRHU6+r1sh4/rf0gAL9jy1GD7UJH42 zzknsujBqUHTeoKfT8tYSTC7TPvID8xPSGQayBtnO5LkbkyXIeBHKF5f+5eJwq6y2E3k qeqbJ9jWKXCCEBsBdNZDmH9qw/ta7uW5Cv2LGh+ZBVGFHCEuKYCf/vaj3JgU1+53xO+L +LJw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1751240536; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=sD1mOg8Vxy8m/AoFo9x4hrCmUs/Um6eC9pUdFjLqKMY=; b=kQMWVJ9kR9eidSOfmukiSPhRCHTxJAmEpJfEj5yVD2sXBnp+rCyok/dpaH6ninnSYW A0UUzAu8KdGbStIw3VOw6ACXnUlRGZKCF4nIs0RsLidZ984KASfKK5TIgmn17TITRTER Zegqr8A5Pe1U15gBTdKDBqc3TMwifdvpZIDhHvSUfl79Yzc9mtjUJKj71D0wQfQH/AoU WL1Z4I1PCIssZifCn+zN/ZBQAw015/Uz9yie3lpyrstxSirsZaWKGR+g4WhRqQJUKDpJ vCKRb/Pa11/ooCk9pkf/Z0iDnmva0z57LpWpEJ8rVNdIbQj7gK8b7jXbDBPFwvRAVYgB hU3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1751240536; s=strato-dkim-0003; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=sD1mOg8Vxy8m/AoFo9x4hrCmUs/Um6eC9pUdFjLqKMY=; b=gNivAbBB/4AD8Oq7Stz68YAp7ZGrsL+En5AWDM4BP8800E3PS8mMf/aCp3LaqPYKUO 2jPRBwH5jz/AMVzcp1Cg== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlLnY4jECd2hdUURIbZgL8PX2QiTuZ3cdB8X/nqjjMQGgB9iFt2EDxFISeGb7Gj0P0" Received: from nimes.localnet by smtp.strato.de (RZmta 51.3.0 AUTH) with ESMTPSA id N87b8b15TNgFC6B (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 30 Jun 2025 01:42:15 +0200 (CEST) From: Bruno Haible Date: Mon, 30 Jun 2025 01:42:15 +0200 Message-ID: <5445693.9aRiPRZThv@nimes> Organization: GNU MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jim Meyering wrote: > That is an option no GNU system needs, since they've all had tac since > before 1992-era textutils. But 'tac' does not have a line-number-limit argument. The POSIX rationale [1] has "While both tail -n$n | tac and tac | head -n$n can be used to output a fixed length of reversed line output, the standard developers decided that it was preferable to have a single utility tail -r -n$n for the same purpose." The second of these alternatives, 'tac | head -n$n' will not work well with non-seekable files: it requires 'tac' to buffer the *entire* input (as huge as it may be), before extracting a few lines of it. The first alternative looks better: 'tail -n$n | tac'. But thinking through it, it seems the logic that 'tail' uses for 'tail -n$n' is also nearly suitable for 'tail -r -n$n': - In function file_lines(), instead of calling dump_remainder at the end, the loop would call xwrite_stdout once for each line (with special considerations for lines that span more than 1 buffer). - In function pipe_lines(), all the relevant data is in memory at the end. It's only a question of doing the xwrite_stdout calls on smaller pieces and in reverse order. When implemented this way, this will be more efficient than to spawn 'tac' as a separate subprocess. Collin Funk wrote: > But I agree that duplicating parts of 'tac' into > 'tail' does not seem ideal. Which parts of the 'tac' program would need to be reused in 'tail'? Maybe the output() function? In any case, the technique for avoiding code duplication is well-known. The programs 'cp', 'mv', 'install' have overlapping functionality without necessitating duplicated code. Bruno [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tail.html From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 30 Jun 2025 11:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bruno Haible , 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.17512841007253 (code B ref 78910); Mon, 30 Jun 2025 11:49:02 +0000 Received: (at 78910) by debbugs.gnu.org; 30 Jun 2025 11:48:20 +0000 Received: from localhost ([127.0.0.1]:41627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWCzi-0001sj-D3 for submit@debbugs.gnu.org; Mon, 30 Jun 2025 07:48:19 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:43278) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uWCze-0001rS-Uk for 78910@debbugs.gnu.org; Mon, 30 Jun 2025 07:48:16 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a4f72cba73so3403483f8f.1 for <78910@debbugs.gnu.org>; Mon, 30 Jun 2025 04:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751284088; x=1751888888; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=fXK/LqkBloHwI1Foir/GJpBQhZ3ddmdjMj52e+sEAtk=; b=NUQGwfXiy4rJK1TyOKXXWCRF+pRbsH5zPSb+WhcBpZd2j1oOGLxddlknu6uh8hAk4R kCyh4ADFnTBCRKJVzcyTQ5LNvPP6YMeJbRiq0BS81Erqd3T2ZgT2H72rbmlsCru/Sezb G9pKIEAuwKTuRMQ7GfgmCyjH/qtgifGOE5c7am3e8CxaLcvcC5CNHUDcjIrfzX9m7A4G ObyoS9l3+L+pPsQrmbqnjarH0sH+iyPTCC5es6Xl0YM53SSV6lXYkYDuSBYyTzplh8RF s/oFjOFQuZZlwD2iEBxV81RwDVlhkOuoHNhX9YnVS9CXy4F41gW2m1C52fQ0WOIUwCik APYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751284088; x=1751888888; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fXK/LqkBloHwI1Foir/GJpBQhZ3ddmdjMj52e+sEAtk=; b=xQjQPcC5EoJwZu55hgg5B/CWt/pGZ83Wdr7TFUKTzmC+gcn3OWY14ulfTSJW7GfkKw qSqN5NkSlHvpNhRHlDW6wNDAVhiGz7zVI9F+DJoy5YiAZ8dM/Uu0nYwPeEe+K6FTHkT3 mwbUyc9dD4c2chYwch8xAvuNCrtbykY0XFWD7pjmmZXdpZ6+aZnhgTynQDrj1XKE6qx8 hn7aum7XnIGQm7/pnL/AfPiS86cvg9uVPwyc+nXzJji7XWwDoRIfeJg3t0egm9m/D+8A 1gRtgl5bYxwAGRjZIhZqZLiNpPzGpJ5PPkTLUZ130/8dQ5R6ZYVC6s4nm+asSnZUrQnv 8sqQ== X-Forwarded-Encrypted: i=1; AJvYcCUqgOH9GBHNPES2ZzURcjy9pljKCBfB2kA2I8c/K5jABmd04PN73MLFMIVsx0xMpEON0Jr2kA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxn2+jXIHmTP9SJO6+ocip423v/Fw16QByrGKKl2JcK/7zAreij Jfos5+Z6GL+lGg7MOwQtlbw9MDPTdIin2v3yONcQxXQ04c4GoQOhXAvwS5hPog== X-Gm-Gg: ASbGnct5vI32UUdsWATGHYhRAQx+IfjqlkisbnEOVFHfnzvShjXTY7JvaKVhB7m03Na mCplVEIc9uk2teBL4sP+GZjKPZ5EJy2ofQQdpzna0bAv3x+86jwmQV6eZLi23B4Yg7VSH7NKWxM THtdG4lOVF8wPrEylQoNUbFTtyIL2ULGLF/HU7QBzg/c4fnM2C0AZ35e6UYs9sXnmsS0DoC9VM+ QrrcDDfTUd/HLTFWLprt281AMSs8qgMHlN49LbErWovLClRH8/MZd4xdO0j0XkJP8Rd+6pxnRm4 DIqSz9hqdUvLVbNS9t/jcioa8cR+EgKmYnCcu62fHEFSGyzfHPUH29Z7JpHGfLiIaqz2elvyu28 TsWMhk1rC3Qd9qNbZyQufPb9DigUCQH40ii8R+aZ2iw== X-Google-Smtp-Source: AGHT+IHmPueA27a9yIUH6ItTE3tz1LGPfR5zh8YXc2zXEIfbsDX38L2ZkiSgvJHEgnaMSC1nFC225A== X-Received: by 2002:a05:6000:418a:b0:3a4:f70d:aff0 with SMTP id ffacd0b85a97d-3a6f312df2bmr9528599f8f.14.1751284087872; Mon, 30 Jun 2025 04:48:07 -0700 (PDT) Received: from [192.168.1.31] (86-44-211-146-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.146]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3aba76e40c0sm5981386f8f.59.2025.06.30.04.48.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Jun 2025 04:48:07 -0700 (PDT) Message-ID: Date: Mon, 30 Jun 2025 12:48:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta References: <87frfloie7.fsf@gmail.com> <5445693.9aRiPRZThv@nimes> Content-Language: en-US From: =?UTF-8?Q?P=C3=A1draig?= Brady In-Reply-To: <5445693.9aRiPRZThv@nimes> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 30/06/2025 00:42, Bruno Haible via GNU coreutils Bug Reports wrote: > Jim Meyering wrote: >> That is an option no GNU system needs, since they've all had tac since >> before 1992-era textutils. > > But 'tac' does not have a line-number-limit argument. > > The POSIX rationale [1] has > > "While both > tail -n$n | tac > and > tac | head -n$n > can be used to output a fixed length of reversed line output, the > standard developers decided that it was preferable to have a single > utility tail -r -n$n for the same purpose." Right these are equivalent, so it's only worth considering the more efficient tail -n$n | tac > The second of these alternatives, 'tac | head -n$n' will not work well > with non-seekable files: it requires 'tac' to buffer the *entire* input > (as huge as it may be), before extracting a few lines of it. > > The first alternative looks better: 'tail -n$n | tac'. But thinking > through it, it seems the logic that 'tail' uses for 'tail -n$n' is > also nearly suitable for 'tail -r -n$n': > - In function file_lines(), instead of calling dump_remainder at the > end, the loop would call xwrite_stdout once for each line (with > special considerations for lines that span more than 1 buffer). > - In function pipe_lines(), all the relevant data is in memory at > the end. It's only a question of doing the xwrite_stdout calls > on smaller pieces and in reverse order. > > When implemented this way, this will be more efficient than to spawn > 'tac' as a separate subprocess. That's not really the unix model though. Having separate processes also implicitly leverages multiple processors so you'd have to account for that. Saying all that I'm not strongly against it, especially since POSIX standardised it, but I'm just surprised they standardised it. Note there are cases where merging functionality can have algorithmic advantages, in which case there is a much stronger argument for merging. For example we have previously mentioned sort --tail=$n or --head=$n would be useful (and more commonly required) functionality. See: https://lists.gnu.org/archive/html/bug-coreutils/2004-04/msg00157.html It would be especially useful if implemented in O(n log n) complexity. cheers, Padraig From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 01 Jul 2025 17:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady , Collin Funk , Jim Meyering Cc: Eric Blake , 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175138968932378 (code B ref 78910); Tue, 01 Jul 2025 17:09:02 +0000 Received: (at 78910) by debbugs.gnu.org; 1 Jul 2025 17:08:09 +0000 Received: from localhost ([127.0.0.1]:58323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWeSl-0008Pw-AK for submit@debbugs.gnu.org; Tue, 01 Jul 2025 13:08:08 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:36223) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uWeSg-0008Nz-HN for 78910@debbugs.gnu.org; Tue, 01 Jul 2025 13:08:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bernhard-voelker.de; s=s1-ionos; t=1751389666; x=1751994466; i=mail@bernhard-voelker.de; bh=yBwrUghUDVmg92ec/K3mqStOSKWRtQo0XwZRDLiDnzs=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=rWTZSnWmdRxONtHv+PQF7MCjFstEXSS1onFNpuo0RmHSPw3o+j39j3Fw0MKaPS7a nA6gIDuDISw0B84PVWYX/CsE1iro9KkNh50NXLeDwi9cUSh4IZAa6Z0MjiU/tNwJE WR84sH/T1F9EYA6deRzHFDSURSPyjpVSxIZA34g32kAyq8a0QOAjiNhR/CvmQbejn D9kVfWtHrAO+2BComQsBm7nLlRFuW6DbOQfKX9m9mwIjDsmPhQ0etIMRfhZMtVIbm 407hHHToOlhrRL3WGCzDqsv2Q23ncedtIQha3r2yDeD57LlPZIKxX5zbXKMrEgW98 t+iQz/6g6jBNKuhiIQ== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from [192.168.101.10] ([93.218.98.140]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MgNQd-1vCIbl2iOl-00pZax; Tue, 01 Jul 2025 19:07:46 +0200 Message-ID: <3fa58b3b-ceef-4bb8-92db-c73a3c38ff52@bernhard-voelker.de> Date: Tue, 1 Jul 2025 19:07:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> <874iw1t2p7.fsf@gmail.com> <19ab8f45-d39c-499a-930b-9b52f5f758f7@draigBrady.com> Content-Language: en-US From: Bernhard Voelker In-Reply-To: <19ab8f45-d39c-499a-930b-9b52f5f758f7@draigBrady.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:hImJtM6ewMDOwMflGWrAD0sy0l5HiCpH9u2gQTBvrtqJJqYI1H3 h31LZxmSzy2Gfg44N4d1BWtyszN9b0oBmtLD6cJEcIfBjcJBobMnMg1k02CzuUS0sCJ057g e81PIYploKlIOEv51EyeEwtoDa72Ggtdlq4zgFzOEfx67Df5Ga9IAYhkKqUsYfTX9S7Sd16 xNfMBYIy2YUZ0IFdiNc4A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:KB5tO4z3RUs=;NIC2eHvRGxa2WU3/kD18WaIH/x2 c5E4ldzRJPxkaTBazbwSOZb6TkmFktyDi5qVZlQ7kdJEld9n3XQBeQUTZSUCcsyPVJD37qM+t pyF2nVR8dmniVpaHKL8cgIXZq9t1fTL65kqFP7vUNPTXt7iI6HuU4uYacEb9kUhEZIiw91Zbl RuD2fDqi/62I5JS4hKU67rGHRZaLTlNIIx6Ke0hqzt+t8pn2KmIGbQw5fRTkfmwP5wqQHB8RS Kni1SQ47SwQzVHk/6xB3lP1wQWgLbt5KA2NOlvHODJhKxaOuEHlu8H6TUKW2irfE791A2WsSO 4BYBf+r2EqKkZS6aKD5fz/l2DUE/jSyXWEIZUalZ3mFwepQSDU9NKY6dedTa5b9VPqURjkyYr aScoqYldf6Gnf2R3R6uTXN/e2oBOOsw86Y13szQK+UmTk5KOuzf+ql+/M+eKIaz3hPR1UcwCw fNG1+80AKH+bOhGBmjEwf9EpDuXwWo899sd9KNMVmDfnRdyOjRpihBSTDgZbBfL6pk+gJUPxl B/caq4yHH7/7KOiBCEhy85MA6c1iUi/Oc/0vQ6ZUpBBNgj7FQ2um/Zin+EBklyy8pphRlZZfo B0P5HXrGn3UHf8R0rrLKGn2f2eW+71nBw27VHjGSL8fce6AnRSzHOIAxKslAYldZRPf/j1QFJ R85LjozbYaaUL5V45Gnx9YvQOVMOVSVOff0GHjJBZR7690ZCDvB4S2FuuUvDTxHUnjYZyEPy6 51XR4A2O9qbjK8fSeUT83AjIoKNONEzqbB5Nb+aa84kup1TSPBQlF2qY+bVJ67gxUmWLwCWeF JMlDiqoQ/znX9IVMnfv4fIP/FMwcw28YWeaN9vA6wCKOhfyxUGPEPDkAzxtUi5b5TslEn96vC EMjFBfiNEY1sfo1rJj7IgTY2d8605WLGQ02bppf8892TBtB+OD93DPwhseZx0yYcGSY1EjxKE Bf8m29+eEiKCVO9CetvWTTJYpvipp+87Kbx4gUHYBUFkpmlIlInbtfPm8xZYkctx06+L0U4G+ CKV81HlfB5MS99EKBKpsbSg3CKGn/NUc/1ZFrdSC0PPnILpAcMGLBuWZHLJ5AiR6Tupk7mbgu DtXo5A/wRtjDUgy9MhPxDMCgoFxqY0tsO4pUQ12y/k2Qs5HXtyAGS8MxWpBZ4vMbPy7zPqH77 w8ecH3BHrwEKwrt24bDkFvNqNcBEqwvm7pC7eBMhFFf+q/m9koJ555suDiwW0z5nvHNxW9rK4 tSxRxzYrzSxLk5o9u05uctcQJ/RIpnCsyJmrnXW+uH+Gh/Ig73roOid4F3lRhue/JXemZX+jv b0yUB7jLg9xvLLGTyV12MYR0Mn9Nrr7nczoRMrnRyG1JyA0AChSlmYXGdUKmISIfO3W3tpLfN xowfSXBbzmQhzIrBivbYUaJXJk2N7xfW+cHFWA/oFo8tG4QHkdUBTbWO2Pu7JgJm4Gi0Ckhk2 5ZEmP7qBUfw15q6ZtOYcAX96t0P+1iW+5c3rhW+bph+LSS6HXz+UoWDHgr4i2t4w2lm/0/USe 3uru4jJgh0bxzVsbnuq4sevUp/Zz8btlrqxTnoWLq+FHtFSyEB5YCiHmSN9gcWLhAHmkL4UVx 15jH1tM6q29SH4S0eA9UoeqKpo6eFL8 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 6/28/25 00:21, P=C3=A1draig Brady wrote: > I wouldn't be rushing to implement it TBH. Furthermore, -r clashes with the existing -f,--follow ... hence it's even = more surprising that POSIX does not specify what should happen for those logica= lly conflicting modes. Have a nice day, Berny From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 01 Jul 2025 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Jim Meyering Cc: =?UTF-8?Q?P=C3=A1draig?= Brady , 78910@debbugs.gnu.org, Collin Funk Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175139814223970 (code B ref 78910); Tue, 01 Jul 2025 19:30:02 +0000 Received: (at 78910) by debbugs.gnu.org; 1 Jul 2025 19:29:02 +0000 Received: from localhost ([127.0.0.1]:58789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWgf3-0006Du-IW for submit@debbugs.gnu.org; Tue, 01 Jul 2025 15:29:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWgez-0006DV-KX for 78910@debbugs.gnu.org; Tue, 01 Jul 2025 15:28:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751398132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YAWNmuxEihvlRp+0RRKX2EJR/eQ4/3gDnA7Ob2j+3FE=; b=f0QmjP6ttbmbuCU0DmYOqdsqk71hwkRk1E4Yv+I2C239E0c3qimnF2lSoxslvjMJ3VEShn lY3xLMwKgYjuMbhoSLBCu4GwLP9Pcx5C4AYU4mpbi548bmGDtnYP5IQVLzAYXCXKp5SSP6 c4qs1PmNa4UKPVa1xkOPc/uXrrRjlyM= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-w4DG7ZtFPmuAiq29_f-RJA-1; Tue, 01 Jul 2025 15:28:49 -0400 X-MC-Unique: w4DG7ZtFPmuAiq29_f-RJA-1 X-Mimecast-MFC-AGG-ID: w4DG7ZtFPmuAiq29_f-RJA_1751398128 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 682A4180028B; Tue, 1 Jul 2025 19:28:48 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.229]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 74BDE19560A7; Tue, 1 Jul 2025 19:28:45 +0000 (UTC) Date: Tue, 1 Jul 2025 14:28:43 -0500 From: Eric Blake Message-ID: References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20250510 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: peVZxyxzI998DL8Wj9NLkR93mZ3T9x1hAwsB6BpeZYQ_1751398128 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, Jun 27, 2025 at 08:51:10AM -0700, Jim Meyering wrote: > > > > > > [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tail.html > > > > tail -r comes from the BSDs. > > Also the BSDs don't have tac(1) which overlaps in functionality quite a bit. > > I'm a bit surprised -r was added by POSIX, but fair enough. > > "Surprised" is putting it lightly. I am disappointed and am tempted to > push back and to delay encumbering GNU tail with -r. > That is an option no GNU system needs, since they've all had tac since > before 1992-era textutils. > > I've Cc'd Eric Blake, in case someone wants to propose adding tac to > POSIX in spite of the fact that the BSDs still lack it. I'll bring up this topic at the next Austin Group meeting. At any rate, it looks like tail -r was added due to this bug report in 2014 (sadly, it is no longer an option to ask Jorg Schilling why he wanted it standardized) https://www.austingroupbugs.net/view.php?id=877 But I did ask at the time (with no answer) why we went with 'tail -r' instead of 'tac'. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 01 Jul 2025 19:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Jim Meyering Cc: =?UTF-8?Q?P=C3=A1draig?= Brady , 78910@debbugs.gnu.org, Collin Funk Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175139841426604 (code B ref 78910); Tue, 01 Jul 2025 19:34:01 +0000 Received: (at 78910) by debbugs.gnu.org; 1 Jul 2025 19:33:34 +0000 Received: from localhost ([127.0.0.1]:58796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWgjV-0006v1-CB for submit@debbugs.gnu.org; Tue, 01 Jul 2025 15:33:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWgjR-0006uN-45 for 78910@debbugs.gnu.org; Tue, 01 Jul 2025 15:33:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751398408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KatmtAXV3KDeckxPz21v2Cc3u/Rb1cpl6q4U1nWYns8=; b=h89li7mEDQBOHw99d5/z5+mRiFLUBaAhqlER+QYupp8ceiuMs4//ZOWyMV5LaTU3EF23hN HppUge77xE9nKsEYHeH0Oetfids6a0FNGbjX6pWd3md/5fVJR+flq1ktdCmIxk6UBvvtSp uk1FM/YrYltQ8++G9RR/y9VP2NobeWA= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-414-wemSEhqMP7ObV_MdEQg6Tg-1; Tue, 01 Jul 2025 15:33:25 -0400 X-MC-Unique: wemSEhqMP7ObV_MdEQg6Tg-1 X-Mimecast-MFC-AGG-ID: wemSEhqMP7ObV_MdEQg6Tg_1751398404 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C4437180028A; Tue, 1 Jul 2025 19:33:23 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.229]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C9945180045B; Tue, 1 Jul 2025 19:33:21 +0000 (UTC) Date: Tue, 1 Jul 2025 14:33:18 -0500 From: Eric Blake Message-ID: References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20250510 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5xneX6BNPRS4L9o088Uzh-1TbZJwVskyRiwYSw6Md1g_1751398404 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Jul 01, 2025 at 02:28:48PM -0500, Eric Blake wrote: > On Fri, Jun 27, 2025 at 08:51:10AM -0700, Jim Meyering wrote: > > > > > > > > [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tail.html > > > > > > tail -r comes from the BSDs. > > > Also the BSDs don't have tac(1) which overlaps in functionality quite a bit. > > > I'm a bit surprised -r was added by POSIX, but fair enough. > > > > "Surprised" is putting it lightly. I am disappointed and am tempted to > > push back and to delay encumbering GNU tail with -r. > > That is an option no GNU system needs, since they've all had tac since > > before 1992-era textutils. > > > > I've Cc'd Eric Blake, in case someone wants to propose adding tac to > > POSIX in spite of the fact that the BSDs still lack it. > > I'll bring up this topic at the next Austin Group meeting. > > At any rate, it looks like tail -r was added due to this bug report in > 2014 (sadly, it is no longer an option to ask Jorg Schilling why he > wanted it standardized) > https://www.austingroupbugs.net/view.php?id=877 > > But I did ask at the time (with no answer) why we went with 'tail -r' > instead of 'tac'. Correction - my comment asking why we didn't go with tac was dated 2014-10-23 at 22:44, https://www.austingroupbugs.net/view.php?id=877#c2428 but the wording to move forward with 'tail -r' was amended in place, so even though the proposed wording was in place before my question at 2014-10-23 15:18, it was later amended on 2014-10-30 to add the Rationale on why 'tail -r' provides a potential algorithmic improvement over 'tac | head -n' when it comes to amount of memory consumed. https://www.austingroupbugs.net/view.php?id=877#c2425 -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 01 Jul 2025 19:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bernhard Voelker Cc: =?UTF-8?Q?P=C3=A1draig?= Brady , Jim Meyering , 78910@debbugs.gnu.org, Collin Funk Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.175139863828820 (code B ref 78910); Tue, 01 Jul 2025 19:38:02 +0000 Received: (at 78910) by debbugs.gnu.org; 1 Jul 2025 19:37:18 +0000 Received: from localhost ([127.0.0.1]:58803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWgn7-0007Uh-8y for submit@debbugs.gnu.org; Tue, 01 Jul 2025 15:37:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWgn4-0007UP-P0 for 78910@debbugs.gnu.org; Tue, 01 Jul 2025 15:37:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751398634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dXh4/dhTGApzNVfUWGu8OcQRxM9kCk3hcTc/Jn7qiyo=; b=SxCcfK4C5Qyi8bpQKLXQaOdOr53NeLB9Jt4yxiWYZwTCCHBAm2nR+MUrOtffnmXdZqYrsd HCpPhQr0jMZdEwOcIBJZ+nHzwf1jd/qSkLIwf6z6e9WMl3WfGyML760fyfWORuwZijreE7 1ep2W16GkqnFTXDZHK/idDuRZu4v6Kc= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-282-N90kxqyAMemWm48KBzAyWQ-1; Tue, 01 Jul 2025 15:37:13 -0400 X-MC-Unique: N90kxqyAMemWm48KBzAyWQ-1 X-Mimecast-MFC-AGG-ID: N90kxqyAMemWm48KBzAyWQ_1751398632 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3FE501956096; Tue, 1 Jul 2025 19:37:11 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.229]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2799F1956087; Tue, 1 Jul 2025 19:37:08 +0000 (UTC) Date: Tue, 1 Jul 2025 14:37:06 -0500 From: Eric Blake Message-ID: References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> <874iw1t2p7.fsf@gmail.com> <19ab8f45-d39c-499a-930b-9b52f5f758f7@draigBrady.com> <3fa58b3b-ceef-4bb8-92db-c73a3c38ff52@bernhard-voelker.de> MIME-Version: 1.0 In-Reply-To: <3fa58b3b-ceef-4bb8-92db-c73a3c38ff52@bernhard-voelker.de> User-Agent: NeoMutt/20250510 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2tfX0AD3ueY549625cNa3jBwwztGDZoIAGA4v_IbXTY_1751398632 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Tue, Jul 01, 2025 at 07:07:45PM +0200, Bernhard Voelker wrote: > On 6/28/25 00:21, =?UTF-8?Q?P=C3=A1draig?= Brady wrote: > > I wouldn't be rushing to implement it TBH. > > Furthermore, -r clashes with the existing [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [170.10.133.124 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [170.10.133.124 listed in sa-trusted.bondedsender.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [54.186.198.63 listed in zen.spamhaus.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [170.10.133.124 listed in bl.score.senderscore.com] 0.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [170.10.133.124 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Tue, Jul 01, 2025 at 07:07:45PM +0200, Bernhard Voelker wrote: > On 6/28/25 00:21, =?UTF-8?Q?P=C3=A1draig?= Brady wrote: > > I wouldn't be rushing to implement it TBH. > > Furthermore, -r clashes with the existing [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [170.10.133.124 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [54.186.198.63 listed in zen.spamhaus.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [170.10.133.124 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [170.10.133.124 listed in bl.score.senderscore.com] 0.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [170.10.133.124 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager On Tue, Jul 01, 2025 at 07:07:45PM +0200, Bernhard Voelker wrote: > On 6/28/25 00:21, Pádraig Brady wrote: > > I wouldn't be rushing to implement it TBH. > > Furthermore, -r clashes with the existing -f,--follow ... hence it's even more > surprising that POSIX does not specify what should happen for those logically > conflicting modes. Remember, the POSIX synopsis lines lists two distinct invocation styles: tail [-f] [-c number|-n number] [file] tail -r [-n number] [file] which means undefined behavior from the POSIX point of view if -f and -r are ever attempted at the same time. Therefore, whatever GNU decides to do on that combo (preferably, diagnose it early with an error and exit, since I can't figure out anything else useful it could do) will not violate POSIX. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org From unknown Sat Aug 09 05:05:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78910: tail does not support -r added by POSIX.1-2024 Resent-From: Collin Funk Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 01 Jul 2025 19:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78910 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Eric Blake Cc: Bernhard Voelker , =?UTF-8?Q?P=C3=A1draig?= Brady , Jim Meyering , 78910@debbugs.gnu.org Received: via spool by 78910-submit@debbugs.gnu.org id=B78910.1751399109613 (code B ref 78910); Tue, 01 Jul 2025 19:46:01 +0000 Received: (at 78910) by debbugs.gnu.org; 1 Jul 2025 19:45:09 +0000 Received: from localhost ([127.0.0.1]:58815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uWguh-000094-5h for submit@debbugs.gnu.org; Tue, 01 Jul 2025 15:45:08 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:57401) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uWgud-00006k-F7 for 78910@debbugs.gnu.org; Tue, 01 Jul 2025 15:45:04 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-237311f5a54so33235875ad.2 for <78910@debbugs.gnu.org>; Tue, 01 Jul 2025 12:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751399097; x=1752003897; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=OPBiun35DFc7X2p1h8W+o5v/DUOS5yjjVdmUTw4NpuQ=; b=hG0noZOcA+oN/EsmQGeFEUacvtfvLij5XoGFHRgdpwGgz6STLPburrVWbxSHVEEpAQ 6mdjgGSHX3Oi6uTmKyyuoChRwSaxiz0l8wZVjmbPdOjqN2ClVfgaD+0R7xKjhI5nFMCA zVKNLESIO6RcQEOuyUoMekI3sYsYlcnQiTXW4/kzQUbP5PXq8OUrPMmxh2om5LRI0dy8 QZpderyXbWpiALA1dCftPBa9wtp8sNy8xFjf9mLfE1Ba6PP+i+C1zd3wQkcRPHbeZujd lOp1KEKnxEi5wIdd1BatVQIPUCy2BUJNo4V7HgNt6CQZax+3N0oDJSpJN5A1FiD+q/aH 4bjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751399097; x=1752003897; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OPBiun35DFc7X2p1h8W+o5v/DUOS5yjjVdmUTw4NpuQ=; b=MLxDey5yB4kTZUN+FZwbtPKiSQ58a7c0TCIU35l5XziVCKO/KjPtC8fSdPnN70D+gX BXB4DqusM2AC83RPxUIPEjAXTpkfrC63K85ybq8Y/55RY9qHXXHb+oSks3SwJFU8gHZ4 iQpBBRS0eJZK5nw9BteTbZXWweCjmeCvm1a37/iKvHp1NruGQUHYFxYozUMPLeA8/uuh qBTwGs2xTNt+QBozaMLEs+Ho4BKvc9tS2tp0/S9DX0rKEGJXq8sFfvZmd6cD9CLnMDBr SwpvtNW/614g7oumpCkLB60gSEsR2SGkeWzTThL223vFuOrViuDSyWns0qK+6pQtBUKs B1Nw== X-Forwarded-Encrypted: i=1; AJvYcCWavNhUE/GrSpGyNjU+3DJ9F485XmGFixsiRC99eD4xoBjSMA+BvmwW78TI5nS37ngzp8wzLA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzlKu50ZMMi4K5O94C4Vh8/Cs7Pi5xXnX/wCAIbpMKT7DsrwQI2 EC875xjH0QpZVGoOsSO2URhT00B+iM+O+6xP7pVV63z+olxY4ghVh2PUUJztkw== X-Gm-Gg: ASbGnctYjpnyWJkd2dX/Q4qVQwIuRlkFtz0MFI9EnDe34DcLFZzyE86ZU50N3Omii9y I7EqksmsoTaMtvJhNEHlq+XgINUk7heYDtYOqC41K4btTtjII8GM78DhUrZNoQGkSg0b0jE1qwG 9PRMVsUKmCk62sJwgBOQEFFlWRlgUlE4jPaMzWI6nyDNsXcZsZUL6FinQerhn9o1jh+clotQTXO 8VweqkYY2oHAWpokf0b0RZ3TASp6eq+CFyfbwM1+BQX/IJNkuBqUqITwhSzSWbcawqj6AdL02uR ftkNrVHHpFKAozeG73qDU7PXrxUkksFJSbU43u25g4Q= X-Google-Smtp-Source: AGHT+IGzFiIDZmG05MJjf6Rslit4SV7WZ3/D7jSlkcxfjQ7c72q2z2qcHErXtF3wOcMQajay8QdYaA== X-Received: by 2002:a17:902:fc8d:b0:234:c5c1:9b5f with SMTP id d9443c01a7336-23ac3afd437mr318152685ad.16.1751399096817; Tue, 01 Jul 2025 12:44:56 -0700 (PDT) Received: from fedora ([2601:646:8081:3770::18c7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb2e21bdsm118149365ad.11.2025.07.01.12.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 12:44:56 -0700 (PDT) From: Collin Funk In-Reply-To: References: <87frfloie7.fsf@gmail.com> <37ed0eba-19ad-4a92-9355-d5dbaddc7c79@draigBrady.com> <874iw1t2p7.fsf@gmail.com> <19ab8f45-d39c-499a-930b-9b52f5f758f7@draigBrady.com> <3fa58b3b-ceef-4bb8-92db-c73a3c38ff52@bernhard-voelker.de> Date: Tue, 01 Jul 2025 12:44:55 -0700 Message-ID: <875xgbwv9k.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Eric, Eric Blake writes: > Remember, the POSIX synopsis lines lists two distinct invocation > styles: > > tail [-f] [-c number|-n number] [file] > tail -r [-n number] [file] Yep, I was going to mention this too. But I was not sure if it should have a mention in the description to make it more clear. > which means undefined behavior from the POSIX point of view if -f and > -r are ever attempted at the same time. Therefore, whatever GNU > decides to do on that combo (preferably, diagnose it early with an > error and exit, since I can't figure out anything else useful it could > do) will not violate POSIX. I think it should be standardized to fail when -f and -r are used together. That seems like the only reasonable behavior to me. Thanks, Collin