Gilles Espinasse wrote: > ----- Original Message ----- > From: "Giuseppe Scrivano" <gscriv...@gnu.org> >> >> For example, assuming that `sort' will soon get the --threads option and >> an user decides to use all cores except one to sort a file, then it can >> be done as: >> >> sort --threads="$(($(core-count) - 1))" huge_file
> that assume --threads is able to handle negative count or 0 > Would not be more efficient to handle the count in core-count? > That mean core-count should always report a minimum of 1 and discount from > total the number passed as an option. Hmm it's a bit surprising that min()/max() are not available as $((shell arithmetic)) or in `expr`. Consequently I agree that adding the option you suggest is useful. What will we call it though? Maybe: --ignore=N If possible reduce the count by N > Probably the first usage of core-count will be to feed make -j Note for commands that do split the data internally and process in parallel, I dislike the --threads name since it implies a particular implementation. So how about sort -j,--jobs to match `make`? Though personally I like --mproc ? cheers, Pádraig.