|
From: | Pádraig Brady |
Subject: | Re: [PATCH] core-count: A new program to count the number of cpucores |
Date: | Tue, 27 Oct 2009 10:31:31 +0000 |
User-agent: | Thunderbird 2.0.0.6 (X11/20071008) |
Bruno Haible wrote: > Pádraig Brady wrote: > >> 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. > > But min() and max() are available through the 'test' > program or shell built-in command. If the user can write > > n=`count-cores` > test ! $n -gt 5 || n=5 > test ! $n -lt 2 || n=2 > > there is no big advantage in additional optional that allow him to > write > > n=`count-cores --min=2 --max=5` No big advantage no. But when you also add in the relative calculation for getting n-1 for example, then it's get's a little too messy in shell for a very common case. cheers, Pádraig.
[Prev in Thread] | Current Thread | [Next in Thread] |