Jim Meyering <jim <at> meyering.net> writes:

> We've been using getlimits in coreutils tests for some time:
> 
>   $ ./getlimits --help
>   Usage: ./getlimits
>   Output platform dependent limits in a format useful for shell scripts.
> 
>   $ ./getlimits
>   CHAR_MAX=127
>   CHAR_OFLOW=128

How about a UI proposal, while we're at it:

getlimits [name]

with no name, list all limits in name=value pairs (and this mode can be used 
as "eval `getlimits`" to set shell variables for all limits at once).  With a 
recognized name, list just the value:

$ ./getlimits CHAR_MAX
127
$

so you can use a particular limit without having to first pollute your shell 
variable namespace, and without having to use a post-process sed.

And maybe also supporting just the limits for a single type, as in:

$ ./getlimits char
CHAR_MAX=127
CHAR_OFLOW=128
CHAR_MIN=-128
CHAR_UFLOW=-129
$

> This would not be added until after 8.2, of course.

But it does sound like it could be a useful tool; +1 from me (after the 
release).

-- 
Eric Blake




Reply via email to