bug#79804: Comm: "--output-delimiter", when set to a zero-sized string, prints null character ('\0')
Collin Funk <[email protected]> Sun, 09 Nov 2025 22:45:03 -0800
| Newsgroups | gmane.comp.gnu.core-utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hi Matthieu, rubisetcie <[email protected]> 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='' 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... It is intentional. Copying text from the info page [1]: ‘--output-delimiter=str’ Print str between adjacent output columns, rather than the default of a single TAB character. 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