GNU bug report logs - #79804
Comm: "--output-delimiter", when set to a zero-sized string, prints null character ('\0')

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Reported by: rubisetcie <rubis.et.cie@HIDDEN>; Keywords: notabug; Done: Collin Funk <collin.funk1@HIDDEN>; Maintainer for coreutils is bug-coreutils@HIDDEN.
bug closed, send any further explanations to 79804 <at> debbugs.gnu.org and rubisetcie <rubis.et.cie@HIDDEN> Request was from Collin Funk <collin.funk1@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Collin Funk <collin.funk1@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 79804 <at> debbugs.gnu.org:


Received: (at 79804) by debbugs.gnu.org; 10 Nov 2025 06:45:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 10 01:45:14 2025
Received: from localhost ([127.0.0.1]:36358 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vILeL-00071W-Vu
	for submit <at> debbugs.gnu.org; Mon, 10 Nov 2025 01:45:14 -0500
Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:59866)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <collin.funk1@HIDDEN>)
 id 1vILeJ-0006zl-46
 for 79804 <at> debbugs.gnu.org; Mon, 10 Nov 2025 01:45:12 -0500
Received: by mail-pl1-x634.google.com with SMTP id
 d9443c01a7336-2964d616df7so34281665ad.3
 for <79804 <at> debbugs.gnu.org>; Sun, 09 Nov 2025 22:45:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1762757105; x=1763361905; 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=/7vDBQGs6r/0aQ/sFDCc1UaDuSHo8Quw7+C7bFn4sIA=;
 b=QRk5r+fX28kMKVtzbpknXlBE9w4mXG60VyORpIJl9bp+cMov8Y+x2M3TQ0MGzeTzP0
 4xX5mZsaaZk0X1zpyisSorXv8Z782yoLFPoXzycMDQOhcle/o47SHchJ+czJdLjcm14l
 2zLluFzL/9d6nTjD6ejwqUQbYvVscCb+IwsC0a1VLCjBi1c4UpnSK7ETdv8PpXjfFbzm
 oeTj/3ZlxOiQlVXPj3Mtldnb5g9tYYpFXI47oMOgRg9BSMT3SUS5XB95uBwf6UoCdt/6
 p5Gr9x+5XbwW6qkkYeoXJI/AA8yycUv/wFDFiprNRREiQhi8rRSaqaZNJyL5iEuCHRVG
 RwbQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1762757105; x=1763361905;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=/7vDBQGs6r/0aQ/sFDCc1UaDuSHo8Quw7+C7bFn4sIA=;
 b=l8CYhh9crP96VY1nJ/DJ+1PaL5vizDGOCj7eayJdeigNJHBjgFszjp8RLTafUAX0aL
 DgdrnCUnSf98INwSQJBOfdR7v+2aQ+JStrW5zDEsyFSCc8RELwrpFFZToX3zc3QsDA+R
 E5tMqL27i6JLYshUn4kpkY8IAnGhaUUsdlll98NFHZNSCAnocAmga5pwPDJhCge7H8f8
 9owxu3HqJnleJD0JrprPfVjzZ0QLWgAUM5VPmDFtyzE7PP74xPzj+heDLdTgsnHUl7oU
 W85C6+VwJAZekPbB0Vn5cSP4UfsNMUateQJ1DVm1D2Y1xBgg0ZVjF9KnYkC/elg3K0Ny
 rpEA==
X-Gm-Message-State: AOJu0YwPxMSzof9/Y78e3E5+3Vx+dMgVhZA8Ox5LNPmW8BVgxFwRyEKw
 ocsZ53Wdly2vHv7aGqSZ5Xogr01wqfz4vnM/sJV63Ua3aPe47RzuUh92Ff6dfw==
X-Gm-Gg: ASbGncsLhBCTmt9rOIFYPFrFwzJ6uUJrBq6+exmn6NPj0dZpFO/ZKzVl8yuBfcKvlGg
 BBMUp1IJ6l97T+Mi8Nttua+nGk7xec8ybpvqI/t3rrA0GYrIyeH71WkTcjPZlvQQ1leEq9rmuU0
 eEWL7epkWCmnt97S3agRYHtJHTnHeHY4Iq+FwWdg16y0kduZbJsNBahOAWjS2DXbvVUlSTd8A/f
 XqlLyyHy0HoKOCQFNWruYUUD7zvBBX3zA2m//7ap00O33L/rV1IB6ANvaatvv6m34atoTJ8h39A
 UTS6Gygsg0497DfjYaCQfSs8+dbvnyLoweODCJSNmqaTTpsdXbG0unFdgoxuFgq063mMB0Hly7y
 0XGazTE5S0FQyT1SrMSy/jrPoV0QZO5+R+qGoQIHUmfWP2NHtJ5ByE9qt46A+GRU3GpUuaMLBMW
 +9DNo=
X-Google-Smtp-Source: AGHT+IH2F3jPKj+lRaoQmBxGD15fAAHVUQ5erCkBkmSgZ4Jqa949uLjZIRbVF5FyIjLTZWM+CtPhRQ==
X-Received: by 2002:a17:902:f64f:b0:298:1156:acd5 with SMTP id
 d9443c01a7336-2981156ad51mr41394385ad.39.1762757104470; 
 Sun, 09 Nov 2025 22:45:04 -0800 (PST)
Received: from fedora ([2601:646:8081:3770::43bc])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-7b0c9c09cd6sm10441159b3a.23.2025.11.09.22.45.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 09 Nov 2025 22:45:04 -0800 (PST)
From: Collin Funk <collin.funk1@HIDDEN>
To: rubisetcie <rubis.et.cie@HIDDEN>
Subject: Re: bug#79804: Comm: "--output-delimiter", when set to a zero-sized
 string, prints null character ('\0')
In-Reply-To: <CADDn39+Ry1R7Ude5hVXHcTE+OpB1M6pxm56EFZ+t-Fs9Gc_RNw@HIDDEN>
References: <CADDn39+Ry1R7Ude5hVXHcTE+OpB1M6pxm56EFZ+t-Fs9Gc_RNw@HIDDEN>
Date: Sun, 09 Nov 2025 22:45:03 -0800
Message-ID: <875xbi4c9c.fsf@HIDDEN>
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: 1.1 (+)
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:  Hi Matthieu,
 rubisetcie writes: > Hello dear developers/maintainers, 
 I hope you're doing alright. > > I don't know if this is a bug, a workaround
 or an intended behavior, but I > need `comm` to suppress the "delimiter".
 > > When I r [...] 
 Content analysis details:   (1.1 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (collin.funk1[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (collin.funk1[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2607:f8b0:4864:20:0:0:0:634 listed in]
 [list.dnswl.org]
 0.0 LOTS_OF_MONEY          Huge... sums of money
 0.9 MONEY_NOHTML           Lots of money in plain text
X-Debbugs-Envelope-To: 79804
Cc: 79804 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.1 (/)

Hi Matthieu,

rubisetcie <rubis.et.cie@HIDDEN> writes:

> Hello dear developers/maintainers, I hope you're doing alright.
>
> I don't know if this is a bug, a workaround or an intended behavior, but I
> need `comm` to suppress the "delimiter".
>
> When I run the following command, in which I've set the option `
> --output-delimiter` to an empty string:
> `comm -3 --nocheck-order --output-delimiter=3D'' file1 file2 > file3`
>
> The output `*file3*` contains *unwanted null characters* ('\0') where the
> delimiter should've been...
>
> As far as I see, there don't seem to be a way to completely disable writi=
ng
> the delimiter, whether this is intentional or not...

It is intentional. Copying text from the info page [1]:

    =E2=80=98--output-delimiter=3Dstr=E2=80=99
        Print str between adjacent output columns, rather than the
        default of a single TAB character.
=20=20=20=20
        The delimiter str may be empty, in which case the ASCII NUL
        character is used to delimit output columns.

You can remove the NUL's with 'tr':

    $ head -c 3 /dev/zero | od -A n -t x1
     00 00 00
    $ head -c 3 /dev/zero | tr -d '\0' | od -A n -t x1

Thanks,
Collin

[1] https://www.gnu.org/software/coreutils/manual/html_node/comm-invocation=
.html#comm-invocation




Information forwarded to bug-coreutils@HIDDEN:
bug#79804; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Nov 2025 06:01:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 10 01:01:49 2025
Received: from localhost ([127.0.0.1]:36030 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vIKyK-0004HN-SF
	for submit <at> debbugs.gnu.org; Mon, 10 Nov 2025 01:01:49 -0500
Received: from lists.gnu.org ([2001:470:142::17]:59430)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <rubis.et.cie@HIDDEN>)
 id 1vI4Mm-000831-5O
 for submit <at> debbugs.gnu.org; Sun, 09 Nov 2025 07:17:57 -0500
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 <rubis.et.cie@HIDDEN>)
 id 1vI4Mf-00063y-1I
 for bug-coreutils@HIDDEN; Sun, 09 Nov 2025 07:17:49 -0500
Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <rubis.et.cie@HIDDEN>)
 id 1vI4Md-00050S-5v
 for bug-coreutils@HIDDEN; Sun, 09 Nov 2025 07:17:48 -0500
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-6406f3dcc66so3650847a12.3
 for <bug-coreutils@HIDDEN>; Sun, 09 Nov 2025 04:17:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1762690663; x=1763295463; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=e1RkW7OPNi8xJcZyNH4vknYZ+VJ8oxlAKCRswdyzW/I=;
 b=C24+dEvAgccOT5AnbHiyhPk68PKuCQv54V6ZlvgQoyvHLzOQmo5uAE8CIOxbQ1TB9s
 qWUvmDsN0d6P1XF1beLqETwqysiHj8uoFeGv7CSEEtWhfPBUC2K16v4D6QegYWPS1m4r
 fIes0v7Ct9XQFaVnNcuylLdiJVzWxbara+wxE0ViCvtvmGuKo71F71mSBCCNgMdPBA+4
 /f1lVJvPFdA4Is0rWYm8wIjpIxfqwx/ykxEJVp7JRVURbBRS3GTSU3SDLu7asBslRqRj
 o55mh5GCvYJ3XlVdo4tRDAuoRE+zD0yHowEfDPfRnqa2PpjLjDQ/jg7mGJtVcsW4/384
 UVOQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1762690663; x=1763295463;
 h=to:subject:message-id:date:from:mime-version:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=e1RkW7OPNi8xJcZyNH4vknYZ+VJ8oxlAKCRswdyzW/I=;
 b=dywwIjyL+EMzMAV+yGs7Ey0P6jzIU5vH6hcekKgzOENf2EcMe+N0BmlecHq4s/Y9VB
 e1AyFl+BH7OOCWKIqMK4Qi/3vOjIYxnw2TmnASzhGlyfjrpvFweDw7FvgGF7jyp7ZArg
 aHhbjWzKMj748MjKRYawU7aoNRkseY1/UsnZnbb894f6f6/gS/PmZ0VjPChaZGZmM8Ge
 SCJAtdc8OVkGnnjezZj9Y++vM/+p1vdLtMuiQxYje310V7IE/GJrlLnBO+DCNwSAWf4A
 EyjMMpKw0/QiNPIU3b8SQR63hQuOc8CgYO9zSltJyYZlSrnKd+HlELRofPmMzk7e/NQN
 e48g==
X-Gm-Message-State: AOJu0Yxg00xaG+qTlgBMfs0pVcZ16Lpnawy9TI4DhPOIO4NiXoJCqtZ/
 5xTbyoxf2Ui9riys9uvVh0YZzdfpfmao/8MkWuzDkhSU27ZEmEVNHOXWA4kv/QoRLXXIfJNOgUp
 0OkcRJhW0pm6nO1H2Y2bR16F+yC0JSgADhyY4
X-Gm-Gg: ASbGncu4heSyjNnYKMJQ0Ezz6Iu2YE0wgvEvY62B/yS3aLH84U5OBqtYd0SaED/DmQN
 vfD9XLo+LddWR3Q+tqmjPwrMD1zWg7AaEK6HUhI1mB3xeTRydTkSqTt2dnmjn5f9uoEiBmP0Qqh
 JvLoKZ+1U0QoK57KH4Lj4k+jhBGgX93jbF6aKqmyqfU3jD/nsvw6rOpRzUodr84WkEsxMFi1aml
 UvgBxkA/K12tUQROviVMWBttL1dWPpFWkHG1Wx8U/i/NrQ4NdTEP+XE1/VucniRDbeotf1hYM5M
 w2rjOUmB+LssjlF4Rdxwa5tyQ2rY
X-Google-Smtp-Source: AGHT+IHgpJVEwzhRVlCH/iM8AeIdAz7FySXbysgMTmIzC3RVkKO5NTiBuy1gk55S1iSdwRcYLHxjF+aQYeWPrtw9nLw=
X-Received: by 2002:a17:907:3fa8:b0:b72:8489:7e65 with SMTP id
 a640c23a62f3a-b72e05bd41amr526229266b.31.1762690662927; Sun, 09 Nov 2025
 04:17:42 -0800 (PST)
MIME-Version: 1.0
From: rubisetcie <rubis.et.cie@HIDDEN>
Date: Sun, 9 Nov 2025 13:17:06 +0100
X-Gm-Features: AWmQ_bngDdP3-ECa6l3V2-QHvzO5TMZ0WSsKqCbxP6FvABrtWVJijIJXnQKqU0U
Message-ID: <CADDn39+Ry1R7Ude5hVXHcTE+OpB1M6pxm56EFZ+t-Fs9Gc_RNw@HIDDEN>
Subject: Comm: "--output-delimiter", when set to a zero-sized string, prints
 null character ('\0')
To: bug-coreutils@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000d012cb064328669d"
Received-SPF: pass client-ip=2a00:1450:4864:20::52f;
 envelope-from=rubis.et.cie@HIDDEN; helo=mail-ed1-x52f.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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_FROM=0.001,
 HTML_MESSAGE=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.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 10 Nov 2025 01:01:47 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--000000000000d012cb064328669d
Content-Type: text/plain; charset="UTF-8"

Hello dear developers/maintainers, I hope you're doing alright.

I don't know if this is a bug, a workaround or an intended behavior, but I
need `comm` to suppress the "delimiter".

When I run the following command, in which I've set the option `
--output-delimiter` to an empty string:
`comm -3 --nocheck-order --output-delimiter='' file1 file2 > file3`

The output `*file3*` contains *unwanted null characters* ('\0') where the
delimiter should've been...

As far as I see, there don't seem to be a way to completely disable writing
the delimiter, whether this is intentional or not...

The culprit seems to be these two lines:
https://github.com/coreutils/coreutils/blob/master/src/comm.c#L485
Why setting `col_sep_len` to 1 even when `col_sep` is empty?

If this is a bug, I volunteer to fix it. :)

Thank you in advance,
Matthieu Carteron

--000000000000d012cb064328669d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello dear developers/maintainers, I hope you&#39;re =
doing alright.</div><div><br></div><div>I don&#39;t know if this is a bug, =
a workaround or an intended behavior, but I need `<span style=3D"font-famil=
y:monospace">comm</span>` to suppress the &quot;delimiter&quot;.</div><div>=
<br></div><div>When I run the following command, in which I&#39;ve set the =
option `<span style=3D"font-family:monospace">--output-delimiter</span>` to=
 an empty string:</div><div>`<span style=3D"font-family:monospace">comm=C2=
=A0-3 --nocheck-order --output-delimiter=3D&#39;&#39; file1 file2 &gt; file=
3</span>`</div><div><br></div><div>The output `<i>file3</i>` contains <b>un=
wanted null characters</b> (&#39;\0&#39;) where the delimiter should&#39;ve=
 been...</div><div><br></div><div>As far as I see, there don&#39;t seem to =
be a way to completely disable writing the delimiter, whether this is inten=
tional or not...</div><div><br></div><div>The culprit seems to be these two=
 lines:=C2=A0<a href=3D"https://github.com/coreutils/coreutils/blob/master/=
src/comm.c#L485">https://github.com/coreutils/coreutils/blob/master/src/com=
m.c#L485</a></div><div>Why setting `<span style=3D"font-family:monospace">c=
ol_sep_len</span>` to 1 even when `<span style=3D"font-family:monospace">co=
l_sep</span>` is empty?</div><div><br></div><div>If this is a bug, I volunt=
eer to fix it. :)</div><div><br></div><div>Thank you in advance,</div><div>=
Matthieu Carteron</div></div>

--000000000000d012cb064328669d--




Acknowledgement sent to rubisetcie <rubis.et.cie@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#79804; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 11 Nov 2025 22:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.