summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/awk.1
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man/man1/awk.1')
-rw-r--r--usr/src/man/man1/awk.180
1 files changed, 18 insertions, 62 deletions
diff --git a/usr/src/man/man1/awk.1 b/usr/src/man/man1/awk.1
index 14d5a145ec..b32c4d84ee 100644
--- a/usr/src/man/man1/awk.1
+++ b/usr/src/man/man1/awk.1
@@ -2,26 +2,26 @@
.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
-.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
.\" This notice shall appear on any product containing this material.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH awk 1 "22 Jun 2005" "SunOS 5.11" "User Commands"
+.TH AWK 1 "Jun 22, 2005"
.SH NAME
awk \- pattern scanning and processing language
.SH SYNOPSIS
.LP
.nf
-\fB/usr/bin/awk\fR [\fB-f\fR \fIprogfile\fR] [\fB-F\fIc\fR\fR] [' \fIprog\fR '] [\fIparameters\fR]
+\fB/usr/bin/awk\fR [\fB-f\fR \fIprogfile\fR] [\fB-F\fIc\fR\fR] [' \fIprog\fR '] [\fIparameters\fR]
[\fIfilename\fR]...
.fi
.LP
.nf
-\fB/usr/xpg4/bin/awk\fR [\fB-F\fR\fIcERE\fR] [\fB-v\fR \fIassignment\fR]... \fI\&'program'\fR \fB-f\fR \fIprogfile\fR...
+\fB/usr/xpg4/bin/awk\fR [\fB-F\fR\fIcERE\fR] [\fB-v\fR \fIassignment\fR]... \fI\&'program'\fR \fB-f\fR \fIprogfile\fR...
[\fIargument\fR]...
.fi
@@ -47,23 +47,19 @@ standard input.
The following options are supported:
.sp
.ne 2
-.mk
.na
\fB\fB-f\fR\fI progfile\fR \fR
.ad
.RS 16n
-.rt
\fBawk\fR uses the set of patterns it reads from \fIprogfile\fR.
.RE
.sp
.ne 2
-.mk
.na
\fB\fB-F\fR\fIc\fR \fR
.ad
.RS 16n
-.rt
Uses the character \fIc\fR as the field separator (FS) character. See the
discussion of \fBFS\fR below.
.RE
@@ -153,89 +149,73 @@ been read respectively. These keywords do not combine with any other patterns.
Built-in variables include:
.sp
.ne 2
-.mk
.na
\fB\fBFILENAME\fR \fR
.ad
.RS 13n
-.rt
name of the current input file
.RE
.sp
.ne 2
-.mk
.na
\fB\fBFS\fR \fR
.ad
.RS 13n
-.rt
input field separator regular expression (default blank and tab)
.RE
.sp
.ne 2
-.mk
.na
\fB\fBNF\fR \fR
.ad
.RS 13n
-.rt
number of fields in the current record
.RE
.sp
.ne 2
-.mk
.na
\fB\fBNR\fR \fR
.ad
.RS 13n
-.rt
ordinal number of the current record
.RE
.sp
.ne 2
-.mk
.na
\fB\fBOFMT\fR \fR
.ad
.RS 13n
-.rt
output format for numbers (default \fB%.6g\fR)
.RE
.sp
.ne 2
-.mk
.na
\fB\fBOFS\fR \fR
.ad
.RS 13n
-.rt
output field separator (default blank)
.RE
.sp
.ne 2
-.mk
.na
\fB\fBORS\fR \fR
.ad
.RS 13n
-.rt
output record separator (default new-line)
.RE
.sp
.ne 2
-.mk
.na
\fB\fBRS\fR \fR
.ad
.RS 13n
-.rt
input record separator (default new-line)
.RE
@@ -246,10 +226,10 @@ An action is a sequence of statements. A statement can be one of the following:
.in +2
.nf
if ( \fIexpression\fR ) \fIstatement\fR [ else \fIstatement\fR ]
-while ( \fIexpression\fR ) \fIstatement\fR
+while ( \fIexpression\fR ) \fIstatement\fR
do \fIstatement\fR while ( \fIexpression\fR )
-for ( \fIexpression\fR ; \fIexpression\fR ; \fIexpression\fR ) \fIstatement\fR
-for ( \fIvar\fR in \fIarray\fR ) \fIstatement\fR
+for ( \fIexpression\fR ; \fIexpression\fR ; \fIexpression\fR ) \fIstatement\fR
+for ( \fIvar\fR in \fIarray\fR ) \fIstatement\fR
break
continue
{ [ \fIstatement\fR ] .\|.\|. }
@@ -288,69 +268,57 @@ according to the format (see \fBprintf\fR(3C)).
The arithmetic functions are as follows:
.sp
.ne 2
-.mk
.na
\fB\fBcos\fR(\fIx\fR)\fR
.ad
.RS 11n
-.rt
Return cosine of \fIx\fR, where \fIx\fR is in radians. (In
\fB/usr/xpg4/bin/awk\fR only. See \fBnawk\fR(1).)
.RE
.sp
.ne 2
-.mk
.na
\fB\fBsin\fR(\fIx\fR)\fR
.ad
.RS 11n
-.rt
Return sine of \fIx\fR, where \fIx\fR is in radians. (In
\fB/usr/xpg4/bin/awk\fR only. See \fBnawk\fR(1).)
.RE
.sp
.ne 2
-.mk
.na
\fB\fBexp\fR(\fIx\fR)\fR
.ad
.RS 11n
-.rt
Return the exponential function of \fIx\fR.
.RE
.sp
.ne 2
-.mk
.na
\fB\fBlog\fR(\fIx\fR)\fR
.ad
.RS 11n
-.rt
Return the natural logarithm of \fIx\fR.
.RE
.sp
.ne 2
-.mk
.na
\fB\fBsqrt\fR(\fIx\fR)\fR
.ad
.RS 11n
-.rt
Return the square root of \fIx\fR.
.RE
.sp
.ne 2
-.mk
.na
\fB\fBint\fR(\fIx\fR)\fR
.ad
.RS 11n
-.rt
Truncate its argument to an integer. It is truncated toward \fB0\fR when
\fIx\fR >\fB 0\fR.
.RE
@@ -360,7 +328,6 @@ Truncate its argument to an integer. It is truncated toward \fB0\fR when
The string functions are as follows:
.sp
.ne 2
-.mk
.na
\fB\fBindex(\fR\fIs\fR\fB, \fR\fIt\fR\fB)\fR\fR
.ad
@@ -372,7 +339,6 @@ Return the position in string \fIs\fR where string \fIt\fR first occurs, or
.sp
.ne 2
-.mk
.na
\fB\fBint(\fR\fIs\fR\fB)\fR\fR
.ad
@@ -383,7 +349,6 @@ truncates \fIs\fR to an integer value. If \fIs\fR is not specified, $0 is used.
.sp
.ne 2
-.mk
.na
\fB\fBlength(\fR\fIs\fR\fB)\fR\fR
.ad
@@ -395,7 +360,6 @@ there is no argument.
.sp
.ne 2
-.mk
.na
\fB\fBsplit(\fR\fIs\fR, \fIa\fR, \fIfs\fR\fB)\fR\fR
.ad
@@ -409,7 +373,6 @@ separator \fBFS\fR if \fIfs\fR is not given.
.sp
.ne 2
-.mk
.na
\fB\fBsprintf(\fR\fIfmt\fR, \fIexpr\fR, \fIexpr\fR,\|.\|.\|.\|\fB)\fR\fR
.ad
@@ -421,7 +384,6 @@ Format the expressions according to the \fBprintf\fR(3C) format given by
.sp
.ne 2
-.mk
.na
\fB\fBsubstr(\fR\fIs\fR, \fIm\fR, \fIn\fR\fB)\fR\fR
.ad
@@ -436,12 +398,10 @@ returns the \fIn\fR-character substring of \fIs\fR that begins at position
The input/output function is as follows:
.sp
.ne 2
-.mk
.na
\fB\fBgetline\fR\fR
.ad
.RS 11n
-.rt
Set \fB$0\fR to the next input record from the current input file.
\fBgetline\fR returns \fB1\fR for successful input, \fB0\fR for end of file,
and \fB\(mi1\fR for an error.
@@ -609,12 +569,10 @@ that affect the execution of \fBawk\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBPATH\fR.
.sp
.ne 2
-.mk
.na
\fB\fBLC_NUMERIC\fR\fR
.ad
.RS 14n
-.rt
Determine the radix character used when interpreting numeric input, performing
conversions between numeric and string values and formatting numeric output.
Regardless of locale, the period character (the decimal-point character of the
@@ -631,13 +589,12 @@ See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.TS
-tab() box;
-cw(2.75i) |cw(2.75i)
-lw(2.75i) |lw(2.75i)
-.
-ATTRIBUTE TYPEATTRIBUTE VALUE
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
_
-CSINot Enabled
+CSI Not Enabled
.TE
.SS "/usr/xpg4/bin/awk"
@@ -645,15 +602,14 @@ CSINot Enabled
.sp
.TS
-tab() box;
-cw(2.75i) |cw(2.75i)
-lw(2.75i) |lw(2.75i)
-.
-ATTRIBUTE TYPEATTRIBUTE VALUE
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
_
-CSIEnabled
+CSI Enabled
_
-Interface StabilityStandard
+Interface Stability Standard
.TE
.SH SEE ALSO