Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/historical/nawk/bin awk(1): Use .It Xo Fo trick to ...
details: https://anonhg.NetBSD.org/src/rev/16e029130737
branches: trunk
changeset: 368326:16e029130737
user: uwe <uwe%NetBSD.org@localhost>
date: Tue Jul 05 16:59:41 2022 +0000
description:
awk(1): Use .It Xo Fo trick to format optional arguments correctly
diffstat:
external/historical/nawk/bin/awk.1 | 37 +++++++++++++++++++++++++++++--------
1 files changed, 29 insertions(+), 8 deletions(-)
diffs (93 lines):
diff -r 2ca83a8eac90 -r 16e029130737 external/historical/nawk/bin/awk.1
--- a/external/historical/nawk/bin/awk.1 Tue Jul 05 16:21:35 2022 +0000
+++ b/external/historical/nawk/bin/awk.1 Tue Jul 05 16:59:41 2022 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: awk.1,v 1.25 2022/07/05 16:21:35 uwe Exp $
+.\" $NetBSD: awk.1,v 1.26 2022/07/05 16:59:41 uwe Exp $
.\"
.\" Copyright (C) Lucent Technologies 1997
.\" All Rights Reserved
@@ -407,7 +407,10 @@
.Ss String Functions
AWK has the following string functions built-in:
.Bl -tag -width Fn
-.It Fn gensub r s h [t]
+.It Xo Fo gensub
+.Fa r s h\|
+.Oo Fa t
+.Oc Fc Xc
Search the target string
.Ar t
for matches of the regular expression
@@ -463,7 +466,10 @@
are
.Em not
supported at this moment.
-.It Fn gsub r s "[t]"
+.It Xo Fo gsub
+.Fa r s\|
+.Oo Fa t
+.Oc Fc Xc
Same as
.Fn sub
except that all occurrences of the regular expression
@@ -478,7 +484,9 @@
where the string
.Ar t
occurs, or 0 if it does not.
-.It Fn length "[string]"
+.It Xo Fo length
+.Oo Fa string
+.Oc Fc Xc
the length of its argument
taken as a string,
or of
@@ -495,7 +503,10 @@
and
.Va RLENGTH
are set to the position and length of the matched string.
-.It Fn split s a "[fs]"
+.It Xo Fo split
+.Fa s a\|
+.Oo Fa fs
+.Oc Fc Xc
splits the string
.Ar s
into array elements
@@ -521,7 +532,10 @@
.Xr printf 3
format
.Ar fmt .
-.It Fn sub r s "[t]"
+.It Xo Fo sub
+.Fa r s\|
+.Oo Fa t
+.Oc Fc Xc
substitutes
.Ar s
for the first occurrence of the regular expression
@@ -533,7 +547,10 @@
is not given,
.Li $ Ns Va 0
is used.
-.It Fn substr s m [n]
+.It Xo Fo substr
+.Fa s m\|
+.Oo Fa n
+.Oc Fc Xc
Returns the at most
.Ar n\^ Ns No -character
substring of
@@ -568,7 +585,11 @@
Unix Epoch (midnight, January 1, 1970, Coordinated Universal Time).
See also
.Xr time 3 .
-.It Fn strftime "[format [, timestamp]]"
+.\"It Fn strftime "[format [, timestamp]]"
+.It Xo Fo strftime
+.Oo Fa format\|
+.Oo Fa timestamp\|
+.Oc Oc Fc Xc
Formats the time
.Ar timestamp
according to the string
Home |
Main Index |
Thread Index |
Old Index