]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(join invocation): Mention `sort -k 1b,1'.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Feb 2006 02:55:10 +0000 (02:55 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Feb 2006 02:55:10 +0000 (02:55 +0000)
doc/coreutils.texi

index c053081652d66976c8103ee3f39fb7008136cc24..ddf4f3daa671862cdfa8a0c4abe7f4b9b8f05265 100644 (file)
@@ -4738,11 +4738,11 @@ lines that have identical join fields.  Synopsis:
 join [@var{option}]@dots{} @var{file1} @var{file2}
 @end example
 
-@vindex LC_COLLATE
 Either @var{file1} or @var{file2} (but not both) can be @samp{-},
 meaning standard input.  @var{file1} and @var{file2} should be
 sorted on the join fields.
 
+@vindex LC_COLLATE
 Normally, the sort order is that of the
 collating sequence specified by the @env{LC_COLLATE} locale.  Unless
 the @option{-t} option is given, the sort comparison ignores blanks at
@@ -4750,7 +4750,14 @@ the start of the join field, as in @code{sort -b}.  If the
 @option{--ignore-case} option is given, the sort comparison ignores
 the case of characters in the join field, as in @code{sort -f}.
 
-However, as a GNU extension, if the input has no unpairable lines the
+The @command{sort} and @command{join} commands should use consistent
+locales and options if the output of @command{sort} is fed to
+@command{join}.  You can use a command like @samp{sort -k 1b,1} to
+sort a file on its default join field, but if you select a non-default
+locale, join field, separator, or comparison options, then you should
+do so consistently between @command{join} and @command{sort}.
+
+As a GNU extension, if the input has no unpairable lines the
 sort order can be any order that considers two fields to be equal if and
 only if the sort comparison described above considers them to be equal.
 For example:
@@ -4841,6 +4848,8 @@ option---are subject to the specified @var{field-list}.
 @item -t @var{char}
 Use character @var{char} as the input and output field separator.
 Treat as significant each occurrence of @var{char} in the input file.
+Use @samp{sort -t @var{char}}, without the @option{-b} option of
+@samp{sort}, to produce this ordering.
 
 @item -v @var{file-number}
 Print a line for each unpairable line in file @var{file-number}