mdoc(7) police: markup nits.
This commit is contained in:
parent
3f0e2b01ff
commit
9dfcbc3b12
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97464
@ -56,7 +56,7 @@ Arithmetic operations are performed using signed integer math.
|
|||||||
If the
|
If the
|
||||||
.Fl e
|
.Fl e
|
||||||
flag is specified, arithmetic uses the C
|
flag is specified, arithmetic uses the C
|
||||||
.Ql intmax_t
|
.Vt intmax_t
|
||||||
data type (the largest integral type available), and
|
data type (the largest integral type available), and
|
||||||
.Nm
|
.Nm
|
||||||
will detect arithmetic overflow and return an error indication.
|
will detect arithmetic overflow and return an error indication.
|
||||||
@ -67,7 +67,7 @@ If
|
|||||||
is not specified, arithmetic operations and parsing of integer
|
is not specified, arithmetic operations and parsing of integer
|
||||||
arguments will overflow silently according to the rules of the C
|
arguments will overflow silently according to the rules of the C
|
||||||
standard, using the
|
standard, using the
|
||||||
.Ql long
|
.Vt long
|
||||||
data type.
|
data type.
|
||||||
.Pp
|
.Pp
|
||||||
Operators are listed below in order of increasing precedence; all
|
Operators are listed below in order of increasing precedence; all
|
||||||
@ -126,11 +126,11 @@ Unless the
|
|||||||
variable is defined in the process environment, this version of
|
variable is defined in the process environment, this version of
|
||||||
.Nm
|
.Nm
|
||||||
adheres to the
|
adheres to the
|
||||||
.Tn POSIX
|
\*[Px]
|
||||||
Utility Syntax Guidelines, which require that a leading argument beginning
|
Utility Syntax Guidelines, which require that a leading argument beginning
|
||||||
with a minus sign be considered an option to the program.
|
with a minus sign be considered an option to the program.
|
||||||
The standard
|
The standard
|
||||||
.Ql \&--
|
.Fl Fl
|
||||||
syntax may be used to prevent this interpretation.
|
syntax may be used to prevent this interpretation.
|
||||||
However, many historic implementations of
|
However, many historic implementations of
|
||||||
.Nm ,
|
.Nm ,
|
||||||
@ -168,7 +168,7 @@ command in general is historic and inconvenient.
|
|||||||
New applications are advised to use shell arithmetic rather than
|
New applications are advised to use shell arithmetic rather than
|
||||||
.Nm .
|
.Nm .
|
||||||
.Sh ENVIRONMENT
|
.Sh ENVIRONMENT
|
||||||
.Bl -tag -compact -width EXPR_COMPAT
|
.Bl -tag -width ".Ev EXPR_COMPAT"
|
||||||
.It Ev EXPR_COMPAT
|
.It Ev EXPR_COMPAT
|
||||||
If set,
|
If set,
|
||||||
.Nm
|
.Nm
|
||||||
@ -185,7 +185,7 @@ The following example (in
|
|||||||
.Xr sh 1
|
.Xr sh 1
|
||||||
syntax) adds one to the variable
|
syntax) adds one to the variable
|
||||||
.Va a :
|
.Va a :
|
||||||
.Dl a=$(expr $a + 1)
|
.Dl "a=$(expr $a + 1)"
|
||||||
.It
|
.It
|
||||||
This will fail if the value of
|
This will fail if the value of
|
||||||
.Va a
|
.Va a
|
||||||
@ -195,10 +195,10 @@ To protect negative values of
|
|||||||
from being interpreted as options to the
|
from being interpreted as options to the
|
||||||
.Nm
|
.Nm
|
||||||
command, one might rearrange the expression:
|
command, one might rearrange the expression:
|
||||||
.Dl a=$(expr 1 + $a)
|
.Dl "a=$(expr 1 + $a)"
|
||||||
.It
|
.It
|
||||||
More generally, parenthesize possibly-negative values:
|
More generally, parenthesize possibly-negative values:
|
||||||
.Dl a=$(expr \e( $a \e) + 1)
|
.Dl "a=$(expr \e( $a \e) + 1)"
|
||||||
.It
|
.It
|
||||||
This example prints the filename portion of a pathname stored
|
This example prints the filename portion of a pathname stored
|
||||||
in variable
|
in variable
|
||||||
@ -211,7 +211,7 @@ it is necessary to prevent it from being interpreted as the division operator.
|
|||||||
The
|
The
|
||||||
.Li //
|
.Li //
|
||||||
characters resolve this ambiguity.
|
characters resolve this ambiguity.
|
||||||
.Dl expr \*q//$a\*q \&: '.*/\e(.*\e)'
|
.Dl "expr \*q//$a\*q \&: '.*/\e(.*\e)'"
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The following examples output the number of characters in variable
|
The following examples output the number of characters in variable
|
||||||
@ -228,11 +228,11 @@ If the
|
|||||||
command conforms to
|
command conforms to
|
||||||
.St -p1003.1-2001 ,
|
.St -p1003.1-2001 ,
|
||||||
this is simple:
|
this is simple:
|
||||||
.Dl expr -- \*q$a\*q \&: \*q.*\*q
|
.Dl "expr -- \*q$a\*q \&: \*q.*\*q"
|
||||||
.It
|
.It
|
||||||
For portability to older systems, however, a more complicated command
|
For portability to older systems, however, a more complicated command
|
||||||
is required:
|
is required:
|
||||||
.Dl expr \e( \*qX$a\*q \&: \*q.*\*q \e) - 1
|
.Dl "expr \e( \*qX$a\*q \&: \*q.*\*q \e) - 1"
|
||||||
.El
|
.El
|
||||||
.Sh DIAGNOSTICS
|
.Sh DIAGNOSTICS
|
||||||
The
|
The
|
||||||
|
Loading…
Reference in New Issue
Block a user