Red Hat Bugzilla – Bug 1434468
/usr/bin/join displays fields in wrong order for unpairable lines
Last modified: 2018-06-19 01:09:33 EDT
Description of problem: Per join(1) manpage, the "join" utility is supposed to print the "Join field", then remaining fields from FILE1, then remaining fields from FILE2: "Default FORMAT outputs the join field, the remaining fields from FILE1, the remaining fields from FILE2, all separated by CHAR." When printing unpairable lines from FILE2 (using the "-v 2" option) and specifying the second field as "Join field" (using the "-2 2" option), the fields are printed in wrong order. Version-Release number of selected component (if applicable): coreutils-8.4-46.el6 How reproducible: Always Steps to Reproduce: $ echo "a b" | join -v 2 -2 2 /dev/null - Actual results: "a b" Expected results: "b a" Additional info: The issue is not present on RHEL7 (coreutils-8.22). The issue happens only when printing unpaired lines of FILE2. Everything works with FILE1 as shown below: $ echo "a b" | join -v 1 -1 1 - /dev/null a b Joining on second field, displaying unjoinable lines from first file: $ echo "a b" | join -v 1 -1 2 - /dev/null b a
Sorry for replying late on this! This bug seems to be fixed as a side effect of the following upstream commit: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.9-32-gd4db0cb I am able to extract the fix out of the above commit...
Any new about release date please ? Thanks Jarek
(In reply to Jarek Polok from comment #9) > Any new about release date please ? We do not (and cannot) advertise release dates through Bugzilla. Anyway, I will attach an unofficial patch for this bug in case you want to rebuild the package on your own. Needless to say that you are out of support if you take this route.
Created attachment 1406245 [details] [PATCH] join: print fields in the correct order for unpaired lines
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:1862