A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1861 ====================================================================== Reported By: stephane Assigned To: ====================================================================== Project: 1003.1(2024)/Issue8 Issue ID: 1861 Category: Shell and Utilities Type: Error Severity: Objection Priority: normal Status: New Name: Stephane Chazelas Organization: User Reference: Section: xargs utility Page Number: 3601 Line Number: 123207-123214 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2024-10-11 12:32 UTC Last Modified: 2024-10-17 09:08 UTC ====================================================================== Summary: xargs -L broken by https://austingroupbugs.net/view.php?id=243 resolution ======================================================================
---------------------------------------------------------------------- (0006918) geoffclare (manager) - 2024-10-17 09:08 https://austingroupbugs.net/view.php?id=1861#c6918 ---------------------------------------------------------------------- Suggested Interpretation response ------------------------ The standard states that <i>xargs</i> <b>-L</b> <i>number</i> <i>utility</i> invokes <i>utility</i> for for each set of <i>number</i> arguments from standard input, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor. Rationale: ------------- When the <b>-0</b> option was added, there was no intention to change the behavior of <b>-L</b> when <b>-0</b> is not specified, but an attempt to reword the description of <b>-L</b> in a way that covered both cases resulted in such a change. Notes to the Editor (not part of this interpretation): ------------------------------------------------------- On page 3601 line 123207 section xargs (-L), change:<blockquote>Invoke <i>utility</i> for each set of <i>number</i> arguments from standard input. The last invocation of <i>utility</i> shall be with fewer arguments if fewer than <i>number</i> remain. If the <b>-0</b> option is not specified, each line in the standard input shall be treated as containing one argument except that empty lines shall be ignored and a line ending with a trailing unescaped <blank> shall signal continuation to the next non-empty line, inclusive; such continuation shall result in removal of all trailing unescaped <blank> characters and all <newline> characters that immediately follow them from the argument.</blockquote>to:<blockquote>If the <b>-0</b> option is specified, <b>-L</b> <i>number</i> shall be equivalent to <b>-n</b> <i>number</i>. If the <b>-0</b> option is not specified, the <i>utility</i> shall be invoked for each non-empty <i>number</i> logical lines of arguments from standard input. The last invocation of <i>utility</i> shall be with fewer logical lines of arguments if fewer than <i>number</i> remain. Each line in the standard input shall be treated as one logical line except that empty lines shall be ignored and a line ending with a trailing unescaped <blank> shall signal continuation of the logical line to the next non-empty line, inclusive; such continuation shall result in removal of all trailing unescaped <blank> characters and all <newline> characters that immediately follow them from the logical line.</blockquote> On page 3601 line 123218 section xargs (-n), change:<blockquote>(or {LINE_MAX} if there is no <b>-s</b> option)</blockquote>to:<blockquote>(or the default command line length if there is no <b>-s</b> option)</blockquote> Issue History Date Modified Username Field Change ====================================================================== 2024-10-11 12:32 stephane New Issue 2024-10-11 12:32 stephane Name => Stephane Chazelas 2024-10-11 12:32 stephane Section => xargs utility 2024-10-11 12:32 stephane Page Number => 3601 2024-10-11 12:32 stephane Line Number => 123207-123214 2024-10-11 16:28 stephane Note Added: 0006913 2024-10-12 05:57 stephane Note Added: 0006914 2024-10-14 16:13 geoffclare Note Added: 0006916 2024-10-15 05:09 stephane Note Added: 0006917 2024-10-15 05:23 stephane Note Edited: 0006917 2024-10-17 09:08 geoffclare Note Added: 0006918 ======================================================================
