GNU bug report logs - #54625
Why do I need to specify `-o auto` for join's `-e` option to work?

Previous Next

Package: coreutils;

Reported by: Iago-lito <iago-lito <at> cleb.io>

Date: Tue, 29 Mar 2022 13:28:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pádraig Brady <P <at> draigBrady.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#54625: closed (Why do I need to specify `-o auto` for join's
 `-e` option to work?)
Date: Tue, 29 Mar 2022 15:38:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 29 Mar 2022 16:36:57 +0100
with message-id <e67e09b8-b39a-6fec-5c06-e04185d4bf0d <at> draigBrady.com>
and subject line Re: bug#54625: Why do I need to specify `-o auto` for join's `-e` option to work?
has caused the debbugs.gnu.org bug report #54625,
regarding Why do I need to specify `-o auto` for join's `-e` option to work?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
54625: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=54625
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Iago-lito <iago-lito <at> cleb.io>
To: bug-coreutils <at> gnu.org
Subject: Why do I need to specify `-o auto` for join's `-e` option to work?
Date: Tue, 29 Mar 2022 10:07:08 +0200
[Message part 3 (text/plain, inline)]
Hello,

    This is a follow-up to this (yet) unanswered post on SE U&L: 
https://unix.stackexchange.com/q/696259/87656, which I'm cross-posting 
here. Don't hesitate to fire if it's the wrong place.

With the following two simple files:

|a.txt|

|1 a 2 b 5 c |

|b.txt|

|2 x 4 y 5 z |

The following command does not behave like expected:

|$ join -a 1 -a 2 -e 0 a.txt b.txt 1 a 2 b x 4 y 5 c z |

I would expect the option |-e 0| to fill up missing values with zeroes. 
However, the following does work:

|$ join -a 1 -a 2 -e 0 -o auto a.txt b.txt 1 a 0 2 b x 4 0 y 5 c z |

Reading documentation from |$ man join|, I see no connection between 
|-o| and |-e| that would make the above behaviour meaningful. Instead, I 
find it misleading that a useless |-o auto| needs to be inserted into my 
command for |-e 0| to work..

Is there an explanation, to be clarified in the manpage? Or is it a bug?

(btw:

$ join (GNU coreutils) 9.0
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel.
)



--
Iago-lito

[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Iago-lito <iago-lito <at> cleb.io>, 54625-done <at> debbugs.gnu.org
Subject: Re: bug#54625: Why do I need to specify `-o auto` for join's `-e`
 option to work?
Date: Tue, 29 Mar 2022 16:36:57 +0100
[Message part 6 (text/plain, inline)]
On 29/03/2022 09:07, Iago-lito wrote:
> Hello,
> 
>       This is a follow-up to this (yet) unanswered post on SE U&L:
> https://unix.stackexchange.com/q/696259/87656, which I'm cross-posting
> here. Don't hesitate to fire if it's the wrong place.
> 
> With the following two simple files:
> 
> |a.txt|
> 
> |1 a 2 b 5 c |
> 
> |b.txt|
> 
> |2 x 4 y 5 z |
> 
> The following command does not behave like expected:
> 
> |$ join -a 1 -a 2 -e 0 a.txt b.txt 1 a 2 b x 4 y 5 c z |
> 
> I would expect the option |-e 0| to fill up missing values with zeroes.
> However, the following does work:
> 
> |$ join -a 1 -a 2 -e 0 -o auto a.txt b.txt 1 a 0 2 b x 4 0 y 5 c z |
> 
> Reading documentation from |$ man join|, I see no connection between
> |-o| and |-e| that would make the above behaviour meaningful. Instead, I
> find it misleading that a useless |-o auto| needs to be inserted into my
> command for |-e 0| to work..
> 
> Is there an explanation, to be clarified in the manpage? Or is it a bug?


The info doc is clearer that the output of missing fields need to be
explicitly enabled, https://www.gnu.org/software/coreutils/join :

  ‘-e STRING’
     Replace those output fields that are missing in the input with
     STRING.  I.e., missing fields specified with the ‘-12jo’ options.
I agree that the man page should mention this also,
which I've done in the attached.

Marking this as done.
thanks,
Pádraig

[join-e-usage.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 50 days ago.

Previous Next


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