Jim Meyering wrote, On 08/30/2012 05:02 AM: > Pádraig Brady wrote: >> Thanks for the detailed rationale, however >> ... >> >> So currently I'd be 70:30 against adding such a variable. > > Thanks for replying, Pádraig. Those are good points. > Another is that we have a strong aversion to adding > support for new environment variables in coreutils programs > because it makes formerly-robust usage prone to malfunction or abuse. >
Thanks for the detailed reply. I understand your objection to a new environment variable. Perhaps you can suggest an alternative: I'm looking for a way to make a script (that uses sort with pipe input) be adapted "well enough" to work on servers with varying hardware (memory and CPU). When using regular file input, the memory usage will be efficient (with the recent changes, based on the file size and up to a certain threshold of total/available physical memory). But when using pipes, there's no easy way to set memory usage, and the default is very low. Perhaps there's a way to use "default_sort_size()" with pipe input? Or expose the value returned by "default_sort_size()" as a command-line program (similar to "nproc")? (I couldn't find a portable way to report total/available ram across different unix machines). possibly going on a tangent here, but a small program like "physmem" that will report either total, available, or recommended ram could be useful. Any suggestions will be appreciated. Thanks, -gordon
