With the following two simple files:


1 a
2 b
5 c


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? Or should I file this as a bug to coreutils?

  • 1
    Since you tagged with coreutils, I assume this is about the GNU version of join (the one found on Linux systems), right? If not, please undo the tag edit I made.
    – terdon
    Mar 21, 2022 at 14:09

1 Answer 1


Well, this has been filed as a formal report there. The answer is that there is a connection between -e and -o, which is explained in the info join page. A patch has been released to also clarify it in the man info page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .