我正在一个接一个地整理大量文件。使用sort -o file file
. for 循环在中途停止,在重新启动之前我想使用 sort 的-c
选项来加速排序。但它说-co
选项不兼容。为什么会这样?
sort --version
sort (GNU coreutils) 8.13
OS: Ubuntu 12.10
Run Code Online (Sandbox Code Playgroud)
因为您告诉它您只想 --check 不生成输出,并且您还指定要排序的 --output 转到某个文件。这些是相互排斥的概念,它们在 sort.c (gnu coreutils 8.20) 中使用
if (checkonly)
{
…
if (outfile)
{
static char opts[] = {0, 'o', 0};
opts[0] = checkonly;
incompatible_options (opts);
}
Run Code Online (Sandbox Code Playgroud)