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



Reply via email to