HomeFreeBSD

MFC r320210:

Description

MFC r320210:

join(1): Fix field ordering for -v output

Per POSIX, join(1) (in modes other than -o) is a concatenation of selected
character fields. The joined field is first, followed by fields in the
order they occurred in the input files.

Our join(1) utility previously handled this correctly for lines with a match
in the other file. But it failed to order output fields correctly for
unmatched lines, printed in -a and -v modes.

A simple test case is:

$ touch a
$ echo "2 1" > b
$ join -v2 -2 2 a b
1 2

PR: 217711

Details

Provenance
eadlerAuthored on
Parents
rS331163: MFC r303412:
Branches
Unknown
Tags
Unknown