m4.1 (2b7af31cf5e70677f52214702a95d4225564c52d) m4.1 (88497f0c68b1469cbf8560b8c4a022dbc509ceae)
1.\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $
1.\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $
2.\" @(#) $OpenBSD: m4.1,v 1.59 2010/10/21 13:20:51 jmc Exp $
2.\" @(#) $OpenBSD: m4.1,v 1.62 2014/04/14 07:00:47 jmc Exp $
3.\"
4.\" Copyright (c) 1989, 1993
5.\" The Regents of the University of California. All rights reserved.
6.\"
7.\" This code is derived from software contributed to Berkeley by
8.\" Ozan Yigit at York University.
9.\"
10.\" Redistribution and use in source and binary forms, with or without

--- 17 unchanged lines hidden (view full) ---

28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\" $FreeBSD$
35.\"
3.\"
4.\" Copyright (c) 1989, 1993
5.\" The Regents of the University of California. All rights reserved.
6.\"
7.\" This code is derived from software contributed to Berkeley by
8.\" Ozan Yigit at York University.
9.\"
10.\" Redistribution and use in source and binary forms, with or without

--- 17 unchanged lines hidden (view full) ---

28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\" $FreeBSD$
35.\"
36.Dd October 21, 2010
36.Dd January 12 2014 $
37.Dt M4 1
38.Os
39.Sh NAME
40.Nm m4
41.Nd macro language processor
42.Sh SYNOPSIS
43.Nm
44.Op Fl gPs

--- 38 unchanged lines hidden (view full) ---

83possibly followed by alphanumeric or underscore characters, e.g.,
84valid macro names match the pattern
85.Dq [a-zA-Z_][a-zA-Z0-9_]* .
86.Pp
87In arguments to macros, leading unquoted space, tab, and newline
88.Pq Sq \en
89characters are ignored.
90To quote strings, use left and right single quotes
37.Dt M4 1
38.Os
39.Sh NAME
40.Nm m4
41.Nd macro language processor
42.Sh SYNOPSIS
43.Nm
44.Op Fl gPs

--- 38 unchanged lines hidden (view full) ---

83possibly followed by alphanumeric or underscore characters, e.g.,
84valid macro names match the pattern
85.Dq [a-zA-Z_][a-zA-Z0-9_]* .
86.Pp
87In arguments to macros, leading unquoted space, tab, and newline
88.Pq Sq \en
89characters are ignored.
90To quote strings, use left and right single quotes
91.Po e.g.,\ \&
92.Sq "\ this is a string with a leading space"
93.Pc .
91.Pq e.g., Sq \ \&this is a string with a leading space .
94You can change the quote characters with the
95.Ic changequote
96built-in macro.
97.Pp
98Most built-ins do not make any sense without arguments, and hence are not
99recognized as special when not followed by an open parenthesis.
100.Pp
101The options are as follows:

--- 151 unchanged lines hidden (view full) ---

253Prints the names and definitions for the named items, or for everything
254if no arguments are passed.
255.It Fn errprint msg
256Prints the first argument on the standard error output stream.
257.It Fn esyscmd cmd
258Passes its first argument to a shell and returns the shell's standard output.
259Note that the shell shares its standard input and standard error with
260.Nm .
92You can change the quote characters with the
93.Ic changequote
94built-in macro.
95.Pp
96Most built-ins do not make any sense without arguments, and hence are not
97recognized as special when not followed by an open parenthesis.
98.Pp
99The options are as follows:

--- 151 unchanged lines hidden (view full) ---

251Prints the names and definitions for the named items, or for everything
252if no arguments are passed.
253.It Fn errprint msg
254Prints the first argument on the standard error output stream.
255.It Fn esyscmd cmd
256Passes its first argument to a shell and returns the shell's standard output.
257Note that the shell shares its standard input and standard error with
258.Nm .
261.It Fn eval expr
259.It Fn eval expr[,radix[,minimum]]
262Computes the first argument as an arithmetic expression using 32-bit
263arithmetic.
264Operators are the standard C ternary, arithmetic, logical,
265shift, relational, bitwise, and parentheses operators.
266You can specify
267octal, decimal, and hexadecimal numbers as in C.
260Computes the first argument as an arithmetic expression using 32-bit
261arithmetic.
262Operators are the standard C ternary, arithmetic, logical,
263shift, relational, bitwise, and parentheses operators.
264You can specify
265octal, decimal, and hexadecimal numbers as in C.
268The second argument (if any)
269specifies the radix for the result and the third argument (if any)
266The optional second argument
267.Fa radix
268specifies the radix for the result and the optional third argument
269.Fa minimum
270specifies the minimum number of digits in the result.
271.It Fn expr expr
272This is an alias for
273.Ic eval .
274.It Fn format formatstring arg1 ...
275Returns
276.Fa formatstring
277with escape sequences substituted with

--- 158 unchanged lines hidden (view full) ---

436.Ex -std m4
437.Pp
438But note that the
439.Ic m4exit
440macro can modify the exit status.
441.Sh STANDARDS
442The
443.Nm
270specifies the minimum number of digits in the result.
271.It Fn expr expr
272This is an alias for
273.Ic eval .
274.It Fn format formatstring arg1 ...
275Returns
276.Fa formatstring
277with escape sequences substituted with

--- 158 unchanged lines hidden (view full) ---

436.Ex -std m4
437.Pp
438But note that the
439.Ic m4exit
440macro can modify the exit status.
441.Sh STANDARDS
442The
443.Nm
444utility is mostly compliant with the
444utility is compliant with the
445.St -p1003.1-2008
446specification.
447.Pp
448The flags
445.St -p1003.1-2008
446specification.
447.Pp
448The flags
449.Op Fl dgIot
449.Op Fl dgIPot
450and the macros
451.Ic builtin ,
452.Ic esyscmd ,
453.Ic expr ,
454.Ic format ,
455.Ic indir ,
456.Ic paste ,
457.Ic patsubst ,

--- 4 unchanged lines hidden (view full) ---

462and
463.Ic __file__
464are extensions to that specification.
465.Pp
466.Ic maketemp
467is not supposed to be a synonym for
468.Ic mkstemp ,
469but instead to be an insecure temporary file name creation function.
450and the macros
451.Ic builtin ,
452.Ic esyscmd ,
453.Ic expr ,
454.Ic format ,
455.Ic indir ,
456.Ic paste ,
457.Ic patsubst ,

--- 4 unchanged lines hidden (view full) ---

462and
463.Ic __file__
464are extensions to that specification.
465.Pp
466.Ic maketemp
467is not supposed to be a synonym for
468.Ic mkstemp ,
469but instead to be an insecure temporary file name creation function.
470The change causes no known compatibility issues.
470It is marked by
471.St -p1003.1-2008
472as being obsolescent and should not be used if portability is a concern.
471.Pp
473.Pp
472The output format of tracing and of
474The output format of
475.Ic traceon
476and
473.Ic dumpdef
474are not specified in any standard,
475are likely to change and should not be relied upon.
476The current format of tracing is closely modelled on
477.Nm gnu-m4 ,
478to allow
479.Nm autoconf
480to work.

--- 28 unchanged lines hidden ---
477.Ic dumpdef
478are not specified in any standard,
479are likely to change and should not be relied upon.
480The current format of tracing is closely modelled on
481.Nm gnu-m4 ,
482to allow
483.Nm autoconf
484to work.

--- 28 unchanged lines hidden ---