Commit graph

37 commits

Author SHA1 Message Date
Sevan Janiyan c5ca929f63 Document origins of expr & authors
http://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/usr/man/man1/expr.1

PR:		173979
Approved by:	bcr (mentor)
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D8104
2016-10-05 19:26:35 +00:00
Baptiste Daroussin dc814fa48b Pet manlint 2015-04-26 10:38:26 +00:00
Baptiste Daroussin ef2a65a8bd Use mdoc(7) macros for curly braces 2015-04-26 10:09:26 +00:00
Joel Dahl 35471bf8ef Minor mdoc nits. 2012-05-13 14:16:04 +00:00
Glen Barber 9d496f5ab6 Whitespace cleanup:
o Wrap sentences on to new lines
 o Cleanup trailing whitespace

Found with:	textproc/igor
MFC after:	1 week
X-MFC-With:	r232157
2012-02-25 15:21:43 +00:00
Glen Barber 3102cfe2e2 Fix various typos in manual pages.
Submitted by:	amdmi3
PR:		165431
MFC after:	1 week
2012-02-25 14:31:25 +00:00
Stefan Eßer fa717604a4 Make /bin/expr support 64bit numeric range and range checks by default,
again. This brings back the behaviour of expr in FreeBSD-4, which had been
reverted due to an assumed incompatbility with POSIX.1 for FreeBSD-5.

This issue has been discussed in the freebsd-standards list, and the
consensus was, that POSIX.1 is in fact not violated by this extension,
since it affects only cases of POSIX undefined behaviour (overflow of
signed long).

Other operating systems did upgrade their versions of expr to support
64bit range, after it had been initially brought to FreeBSD. They have
used it for a decade without problems, meanwhile.

The -e option is retained, but it will only select less strict checking
of numeric parameters (leading white-space, leading "+" are allowed and
skipped, an empty string is considered to represent 0 in numeric context.)
The call of check_utility_compat() as a means of establishing backwards
compatibility with FreeBSD-4 is considered obsolete, but preserved in
this commit. It is expected to be removed in a later revision of this
file.
Reviewed by:	bde, das, jilles
MFC after:	2 month (those parts that do not violate POLA)
2011-07-09 12:05:53 +00:00
Jilles Tjoelker f390d8d927 expr(1): Add sh(1) versions of examples, remove an incorrect example.
The three examples are better done using sh(1) itself these days.

The example
  expr -- "$a" : ".*"
is incorrect in the general case, as "$a" may be an operator.

MFC after:	2 weeks
2010-09-09 21:59:53 +00:00
Ruslan Ermilov 9f3cef9108 Fix markup. 2007-03-04 19:52:07 +00:00
Ruslan Ermilov 6fca4c7c3f Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
Ruslan Ermilov 5f05dfac32 Removed harmful empty lines that crept in during the copyright
header update.
2005-01-13 08:46:19 +00:00
Warner Losh 9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Tim J. Robbins 5292d2aec0 Remove BUGS section that talked about missing multibyte character support.
We have support now that the regular expression routines do.
2004-07-12 10:46:55 +00:00
Tim J. Robbins 128dc4a2e3 Document missing multibyte character handling in utilities specified
by POSIX.
2004-07-03 02:03:44 +00:00
Ruslan Ermilov e27480d64d mdoc(7) police:
Revert to using the .Tn POSIX and .Tn ANSI instead of \*[Px] and \*[Ai]
strings; using these strings is unsafe in troff mode, as they include a
change in a font size.

Approved by:	re
2002-11-26 17:55:41 +00:00
Ruslan Ermilov 98d13c7e51 mdoc(7) police: markup fixes.
Approved by:	re
2002-11-25 13:20:30 +00:00
Garrett Wollman c9885518de Create a small library function, check_utility_compat(3), to determine
whether a named utility should behave in FreeBSD 4.x-compatible mode
or in a standard mode (default standard).  The configuration is done
malloc(3)-style, with either an environment variable or a symlink.

Update expr(1) to use this new interface.
2002-10-28 00:15:43 +00:00
Ruslan Ermilov 9dfcbc3b12 mdoc(7) police: markup nits. 2002-05-29 15:18:35 +00:00
Garrett Wollman 94a48596a3 EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,
and -e reflects the historic behavior of FreeBSD's expr.
2002-05-11 03:08:12 +00:00
Garrett Wollman 1393277e29 The response to my POSIX interpretation request says that `expr'
is required to be oblivious to overflow and to use the data type `long'.
(Division by zero is undefined in ISO C so it's still OK to check for it
here.)  Add a new `-e' flag to get the old, more useful behavior.
2002-05-10 22:59:29 +00:00
Garrett Wollman 96ab7da385 Provide an environment variabloe, EXPR_COMPAT, which disables option
parsing for compatibility with old implementations.
2002-04-22 21:23:09 +00:00
Garrett Wollman dc2f94a3ff Typo (if => of). 2002-03-22 20:49:29 +00:00
Garrett Wollman 7316a9465e Add a word of caution about integer arithmetic range and overflow detection. 2002-03-22 20:46:59 +00:00
Garrett Wollman f477880a4f Fix a few formatting brainos and make the formatting of the EXAMPLES
section somewhat clearer.
2002-03-22 20:38:44 +00:00
Garrett Wollman f07e42470f Make expr POSIX-compliant, and fix some bugs. Specifically:
- expr must conform to the Utility Syntax Guidelines, so use
getopt() to eat the (non-existent) options.

- Use the Standard type intmax_t for arithmetic.

- If an argument cannot be *completely* converted to an integer, then
it is a string.

Additionally make some style cleanups near the modified lines.  This
utility is still not completely style-compliant.
2002-03-22 20:18:26 +00:00
Dima Dorfman 7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov 12e720d78b Prepare for mdoc(7)NG. 2000-12-15 17:37:31 +00:00
Ruslan Ermilov be8b149795 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 11:39:41 +00:00
Peter Wemm 2a4562393f $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
Joseph Koshy e5bf7bf46c Add cross-references to test(1) and expr(1) respectively.
PR: 		docs/9111
Submitted by:	Josh Gilliam <josh@quick.net>
1998-12-18 03:16:47 +00:00
Philippe Charnier 15638d89b5 Correct use of .Nm. 1998-05-13 07:43:56 +00:00
Peter Wemm b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Mike Pritchard 7d7ee86eb7 Fix some spelling errors. 1996-01-29 22:53:24 +00:00
Jordan K. Hubbard 2caac73e76 Fix gross spelling and typographical errors pointed out by Keith Bostic. 1994-04-24 01:22:07 +00:00
J.T. Conklin d8c21a3e8a Document the new, less restrictive, behavior of the matching operator. 1993-10-04 22:07:27 +00:00
J.T. Conklin c9fe00dc0b Update to my latest expr (fixes bugs with comparison and matching operators)
Add man page I wrote.
1993-07-21 22:56:14 +00:00