diff options
author | Jim Meyering <jim@meyering.net> | 2004-05-14 07:32:56 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-05-14 07:32:56 +0000 |
commit | d6675522451b73a530d4529e027134d886ccd550 (patch) | |
tree | 5bb845dfc4b540fe6e6064ab69343243619247a6 | |
parent | af7f1c5b2af670b2ce4e0adf2ff1554f46b68c16 (diff) | |
download | coreutils-d6675522451b73a530d4529e027134d886ccd550.tar.xz |
(sort invocation): Document that "sort -m -o F"
might write F before reading all the input.
-rw-r--r-- | doc/coreutils.texi | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index ead568b1d..5e5b8d17a 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -3265,9 +3265,13 @@ starting with 1. So to sort on the second field, you'd use @opindex --output @cindex overwriting of input, allowed Write output to @var{output-file} instead of standard output. -If necessary, @command{sort} reads input before opening +Normally, @command{sort} reads all input before opening @var{output-file}, so you can safely sort a file in place by using commands like @code{sort -o F F} and @code{cat F | sort -o F}. +However, @command{sort} with @option{--merge} (@option{-m}) can open +the output file before reading all input, so a command like @code{cat +F | sort -m -o F - G} is not safe as @command{sort} might start +writing @file{F} before @command{cat} is done reading it. @vindex POSIXLY_CORRECT On newer systems, @option{-o} cannot appear after an input file if |