Bug 168915 - size of integers used by test(1) and sh(1) is not documented
Summary: size of integers used by test(1) and sh(1) is not documented
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2012-06-10 11:30 UTC by Ronald F. Guilmette
Modified: 2018-04-11 20:09 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ronald F. Guilmette 2012-06-10 11:30:06 UTC
I just noticed that whereas the man page for the expr(1) command goes to
some trouble to precisely document the size of integers it uses for all of
its calculations (both with and without the -e option) there is no equivalent
documentation present in the case of the test(1) command or its sh(1)
builtin equivalent.  (See also the "Arithmetic Expansion" section of the
sh(1) man page, where the issue also arises.)

I think that both the test(1) man page and the sh(1) man page should specify
the size of integers used by these programs, and also whether or not the
internal integers used are treated as being signed or not.

It would be Nice to know if the following shell code will or will not
necessarily produce ``correct'' results...

if [ "$x" != 5000000000 ] ; then
  echo Too big to fail\!


I dunno what the proper fix is.  Probably just add some verbage to both
man pages along the lines of what is in the expr(1) man page.  But that is
just a guess.

Maybe something about the size of the ints should also be mentioned in
the following additional man pages as well:

man 1 test
man 1 sh
man 1 builtin
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:45 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped