Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
.\"	$NetBSD: awk.1,v 1.32 2022/07/05 22:50:43 uwe Exp $
.\"
.\" Copyright (C) Lucent Technologies 1997
.\" All Rights Reserved
.\"
.\" Permission to use, copy, modify, and distribute this software and
.\" its documentation for any purpose and without fee is hereby
.\" granted, provided that the above copyright notice appear in all
.\" copies and that both that the copyright notice and this
.\" permission notice and warranty disclaimer appear in supporting
.\" documentation, and that the name Lucent Technologies or any of
.\" its entities not be used in advertising or publicity pertaining
.\" to distribution of the software without specific, written prior
.\" permission.
.\"
.\" LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
.\" IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
.\" SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
.\" THIS SOFTWARE.
.\"
.Dd July 5, 2022
.Dt AWK 1
.Os
.Sh NAME
.Nm awk
.Nd pattern-directed scanning and processing language
.Sh SYNOPSIS
.Nm
.Op Fl F Ar fs
.Op Fl v Ar var\| Ns Cm \&= Ns Ar value
.Op Fl safe
.Op Fl d Ns Op Ar N
.Op Ar prog | Fl f Ar progfile
.Ar
.Nm
.Fl version
.Sh DESCRIPTION
.Nm
is the Bell Labs' implementation of the AWK programming language as
described in the
.Em The AWK Programming Language
by
A.V.\~Aho, B.W.\~Kernighan, P.\^J.\~Weinberger.
.Pp
.Nm
scans each input
.Ar file
for lines that match any of a set of patterns specified literally in
.Ar prog
or in one or more files
specified as
.Fl f Ar progfile .
With each pattern
there can be an associated action that will be performed
when a line of a
.Ar file
matches the pattern.
Each line is matched against the
pattern portion of every pattern-action statement;
the associated action is performed for each matched pattern.
The file name
.Ar -
means the standard input.
Any
.Ar file
of the form
.Ar var\| Ns Cm \&= Ns Ar value
is treated as an assignment, not a filename,
and is executed at the time it would have been opened if it were a filename.
The option
.Fl v
followed by
.Ar var\| Ns Cm \&= Ns Ar value
is an assignment to be done before
.Ar prog
is executed; any number of
.Fl v
options may be present.
The
.Fl F Ar fs
option defines the input field separator to be the regular expression
.Ar fs .
.Pp
The options are as follows:
.Bl -tag -width Fl
.It Fl d Ns Op Ar N
Set debug level to specified number
.Ar N .
If the number is omitted, debug level is set to 1.
.It Fl f Ar filename
Read the AWK program source from specified file
.Ar filename ,
instead of the first command line argument.
Multiple
.Fl f
options may be specified.
.It Fl F Ar fs
Set the input field separator
.Va FS
to the regular expression
.Ar fs .
.It Fl mr Ar NNN , Fl mf Ar NNN
Obsolete, no longer needed options.
Set limit on maximum record or
fields number.
.It Fl safe
Potentially unsafe functions such as
.Fn system
make the program abort (with a warning message).
.It Fl v Ar var\| Ns Cm \&= Ns Ar value
Assign the value
.Ar value
to the variable
.Ar var
before
.Ar prog
is executed.
Any number of
.Fl v
options may be present.
.It Fl version
Print
.Nm
version on standard output and exit.
.El
.Pp
An input line is normally made up of fields separated by white space,
or by the regular expression the built-in variable
.Va FS
is set to.
If
.Va FS
is null, the input line is split into one field per character.
The fields are denoted
.Li $ Ns Va 1 ,
.Li $ Ns Va 2 ,
\&..., while
.Li $ Ns Va 0
refers to the entire line.
Setting any other field causes the re-evaluation of
.Li $ Ns Va 0
Assigning to
.Li $ Ns Va 0
resets the values of all other fields and the
.Va NF
built-in variable.
.Pp
A pattern-action statement has the form
.Lp
.D1 Ar pattern Li \&{ Ar action Li \&}
.Lp
A missing
.Li \&{ Ar action Li \&}
means print the line;
a missing pattern always matches.
Pattern-action statements are separated by newlines or semicolons.
.Pp
An action is a sequence of statements.
Statements are terminated by
semicolons, newlines or right braces.
An empty
.Ar expression-list
stands for
.Li $ Ns Va 0 .
String constants are quoted
.Li \(dq\(dq ,
with the usual C escapes recognized within.
Expressions take on string or numeric values as appropriate,
and are built using the
.Sx Operators
(see next subsection).
Variables may be scalars, array elements
(denoted
.Va x\| Ns Li [ Ns Va i\^ Ns Li ] )
or fields.
Variables are initialized to the null string.
Array subscripts may be any string,
not necessarily numeric;
this allows for a form of associative memory.
Multiple subscripts such as
.Li [ Ns Ar i Ns Li \&, Ns Ar j Ns Li \&, Ns Ar k Ns Li ]
are permitted; the constituents are concatenated,
separated by the value of
.Va SUBSEP .
.Ss Operators
.Nm
operators, in order of decreasing precedence, are:
.Pp
.Bl -tag -width Ic -compact
.It Ic \&( Ns No ... Ns Ic \&)
Grouping
.It Ic $
Field reference
.It Ic ++ --
Increment and decrement, can be used either as postfix or prefix.
.It Ic ^
Exponentiation (the
.Ic **\^
form is also supported, and
.Ic **\^=
for the assignment operator).
.It + \- \&!
Unary plus, unary minus and logical negation.
.It * / %
Multiplication, division and modulus.
.It + \-
Addition and subtraction.
.It Em space
String concatenation.
.It Ic \*[Lt] \*[Gt]
.It Ic <= >=
.It Ic != ==
Regular relational operators
.It Ic ~ !~
Regular expression match and not match
.It Ic in
Array membership
.It Ic "\*[Am]\*[Am]"
Logical AND
.It Ic "||"
Logical OR
.It Ic ?:
C conditional expression.
This is used as
.Ar expr1 Ic \&? Ar expr2 Ic \&: Ar expr3 .
If
.Ar expr1
is true, the result value is
.Ar expr2 ,
otherwise it is
.Ar expr3 .
Only one of
.Ar expr2
and
.Ar expr3
is evaluated.
.It Ic = += -=
.It Ic *= /= %= ^=
Assignment and Operator-Assignment
.El
.Ss Control Statements
The control statements are as follows:
.Bl -tag -width Fn
.It Ic if \&( Ns Ar expression\^ Ns Ic \&) Ar statement Bq Ic else Ar statement
.It Ic while \&( Ns Ar expression\^ Ns Ic \&) Ar statement
.It Ic for \&( Ns Ar expression\^ Ns Ic \&; \
 Ar expression\^ Ns Ic \&; \
 Ar expression\^ Ns Ic \&) Ar statement
.It Ic for \&( Ns Ar var Ic in Ar array\^ Ns Ic \&) Ar statement
.It Ic do Ar statement Ic while \&( Ns Ar expression\^ Ns Ic \&)
.It Ic break
.It Ic continue
.It Ic \&{ Oo Ar statement ... Oc Ic \&}
.It Ar expression
Commonly
.Ar var Ic = Ar expression
.It Ic return Op Ar expression
.It Ic next
Skip remaining patterns on this input line
.It Ic nextfile
Skip rest of this file, open next, start at top
.It Ic delete Ar array\| Ns Cm \&[ Ns Ar expression\^ Ns Cm \&]
Delete an array element
.It Ic delete Ar array
Delete all elements of an array
.It Ic exit Op Ar expression
Exit immediately; status is
.Ar expression
.El
.Ss I/O Statements
The input/output statements are as follows:
.Bl -tag -width Fn
.It Fn close expr
Closes the file or pipe
.Ar expr .
Returns zero on success; otherwise nonzero.
.It Fn fflush expr
Flushes any buffered output for the file or pipe
.Ar expr .
Returns zero on success; otherwise nonzero.
.It Ic getline Op Ar var
Set
.Ar var
(or
.Li $ Ns Va 0
if
.Ar var
is not specified)
to the next input record from the current input file.
.Ic getline
returns 1 for a successful input,
0 for end of file, and \-1 for an error.
.It Ic getline Oo Ar var Oc Ic < Ar file
Set
.Ar var
(or
.Li $ Ns Va 0
if
.Ar var
is not specified)
to the next input record from the specified file
.Ar file .
.It Ar expr Ic \&| getline
Pipes the output of
.Ar expr
into
.Ic getline ;
each call of
.Ic getline
returns the next line of output from
.Ar expr .
.It Ic print Oo Ar expr-list Oc Op Ar redirection
Print arguments separated by the current output field separator
.Va OFS ,
and terminated by the
output record separator
.Va ORS .
.It Ic printf Ar format\| Ns Oo Ic \&, Ar expr-list Oc Op Ar redirection
Format and print its expression list according to
.Ar format .
See
.Xr printf 3
for list of supported formats and their meaning.
.El
.Pp
Both
.Ic print
and
.Ic printf
statements write to standard output by default.
The output is written to the file or pipe specified by
.Ar redirection
if one is supplied, as follows:
.Ic \&> Ar file , ""
.Ic \&>> Ar file , No or
.Ic \&| Ar expr .
Both
.Ar file
and
.Ar expr
may be literal names or parenthesized expressions; identical string values in
different statements denote the same open file.
For that purpose the file names
.Pa /dev/stdin ,
.Pa /dev/stdout ,
and
.Pa /dev/stderr
refer to the program's
.Va stdin ,
.Va stdout ,
and
.Va stderr
respectively (and are unrelated to the
.Xr fd 4
devices of the same names).
.Ss Mathematical and Numeric Functions
AWK has the following mathematical and numerical functions built-in:
.Bl -tag -width Fn
.It Fn atan2 x y
Returns the arctangent of
.Ar x\| Ns Li / Ns Ar y
in radians.
See also
.Xr atan2 3 .
.It Fn cos expr
Computes the cosine of
.Ar expr ,
measured in radians.
See also
.Xr cos 3 .
.It Fn exp expr
Computes the exponential value of the given argument
.Ar expr .
See also
.Xr exp 3 .
.It Fn int expr
Truncates
.Ar expr
to integer.
.It Fn log expr
Computes the value of the natural logarithm of argument
.Ar expr .
See also
.Xr log 3 .
.It Fn rand
Returns random number between 0 and 1.
.It Fn sin expr
Computes the sine of
.Ar expr ,
measured in radians.
See also
.Xr sin 3 .
.It Fn sqrt expr
Computes the non-negative square root of
.Ar expr .
See also
.Xr sqrt 3 .
.It Fn srand [expr]
Sets seed for random number generator
.Pq Fn rand
and returns the previous seed.
.El
.Ss String Functions
AWK has the following string functions built-in:
.Bl -tag -width Fn
.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
.Ar r .
If
.Ar h
is a string beginning with
.Ql g
or
.Ql G ,
then replace all matches of
.Ar r
with
.Ar s .
Otherwise,
.Ar h
is a number indicating which match of
.Ar r
to replace.
If no
.Ar t
is supplied,
.Li $ Ns Va 0
is used instead.
.\"Within the replacement text
.\".Ar s ,
.\"the sequence
.\".Ar \en ,
.\"where
.\".Ar n
.\"is a digit from 1 to 9, may be used to indicate just the text that
.\"matched the
.\".Ar n Ap th
.\"parenthesized subexpression.
.\"The sequence
.\".Ic \e0
.\"represents the entire text, as does the character
.\".Ic & .
Unlike
.Fn sub
and
.Fn gsub ,
the modified string is returned as the result of the function,
and the original target is
.Em not
changed.
Note that the
.Ql \en
sequences within replacement string
.Ar s
supported by GNU
.Nm
are
.Em not
supported at this moment.
.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
are replaced;
.Fn sub
and
.Fn gsub
return the number of replacements.
.It Fn index s t
The position in
.Ar s
where the string
.Ar t
occurs, or 0 if it does not.
.\" .Fn cannot be told to omit parens, so piece this together manually
.\" to mark empty parens optional too
.It Xo Ic length\^ Ns Oo \&( Ns
.Oo Ns
.Fa string
.Oc Ns \&)
.Oc Xc
The length of its argument
taken as a string,
or of
.Li $ Ns Va 0
if no argument.
.It Fn match s r
The position in
.Ar s
where the regular expression
.Ar r
occurs, or 0 if it does not.
The variables
.Va RSTART
and
.Va RLENGTH
are set to the position and length of the matched string.
.It Xo Fo split
.Fa s a\|
.Oo Fa fs
.Oc Fc Xc
Splits the string
.Ar s
into array elements
.Ar a Ns Li [1] ,
.Ar a Ns Li [2] ,
\&...,
.Ar a Ns Li \&[ Ns Ar n Ns Li \&] ,
and returns
.Ar n .
The separation is done with the regular expression
.Ar fs
or with the field separator
.Va FS
if
.Ar fs
is not given.
An empty string as field separator splits the string
into one array element per character.
.It Fn sprintf fmt expr "..."
Returns the string resulting from formatting
.Ar expr
according to the
.Xr printf 3
format
.Ar fmt .
.It Xo Fo sub
.Fa r s\|
.Oo Fa t
.Oc Fc Xc
Substitutes
.Ar s
for the first occurrence of the regular expression
.Ar r
in the target string
.Ar t .
If
.Ar t
is not given,
.Li $ Ns Va 0
is used.
.It Xo Fo substr
.Fa s m\|
.Oo Fa n
.Oc Fc Xc
Returns the at most
.Ar n\^ Ns No -character
substring of
.Ar s
starting at position
.Ar m ,
counted from 1.
If
.Ar n
is omitted, the rest of
.Ar s
is returned.
.It Fn tolower str
Returns a copy of
.Ar str
with all upper-case characters translated to their
corresponding lower-case equivalents.
.It Fn toupper str
Returns a copy of
.Ar str
with all lower-case characters translated to their
corresponding upper-case equivalents.
.El
.Ss Time Functions
This
.Nm
provides the following two functions for obtaining time
stamps and formatting them:
.Bl -tag -width Fn
.It Fn systime
Returns the value of time in seconds since the start of
Unix Epoch (midnight, January 1, 1970, Coordinated Universal Time).
See also
.Xr time 3 .
.\"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
.Ar format .
.Ar timestamp
should be in same form as value returned by
.Fn systime .
If
.Ar timestamp
is missing, current time is used.
If
.Ar format
is missing, a default format equivalent to the output of
.Xr date 1
would be used.
See the specification of ANSI C
.Xr strftime 3
for the format conversions which are supported.
.El
.Ss Other built-in functions
.Bl -tag -width Fn
.It Fn system cmd
Executes
.Ar cmd
and returns its exit status.
.El
.Ss Patterns
Patterns are arbitrary Boolean combinations
(with
.Ic "! || \*[Am]\*[Am]" )
of regular expressions and
relational expressions.
Regular expressions are as in
.Xr egrep 1 .
Isolated regular expressions
in a pattern apply to the entire line.
Regular expressions may also occur in
relational expressions, using the operators
.Ic ~
and
.Ic !~ .
.Ic / Ns Ar re Ns Ic /
is a constant regular expression;
any string (constant or variable) may be used
as a regular expression, except in the position of an isolated regular expression
in a pattern.
.Pp
A pattern may consist of two patterns separated by a comma;
in this case, the action is performed for all lines
from an occurrence of the first pattern
though an occurrence of the second.
.Pp
A relational expression is one of the following:
.Bl -tag -offset indent -width Fn -compact
.It Ar expression matchop regular-expression
.It Ar expression relop expression
.It Ar expression Ic in Ar array-name
.It Ic \&( Ns Ar expr Ns Ic \&, Ar expr Ns Ic \&, Ar ... Ic \&) in Ar array-name
.El
.Pp
where a
.Ar relop
is any of the six relational operators in C,
and a
.Ar matchop
is either
.Ic ~
(matches)
or
.Ic !~
(does not match).
A conditional is an arithmetic expression,
a relational expression,
or a Boolean combination
of these.
.Pp
The special patterns
.Ic BEGIN
and
.Ic END
may be used to capture control before the first input line is read
and after the last.
.Ic BEGIN
and
.Ic END
do not combine with other patterns.
.Pp
If an awk program consists of only actions with the pattern
.Ic BEGIN ,
and the
.Ic BEGIN
action contains no
.Ic getline
statement, awk exits without reading its input when the last
statement in the last
.Ic BEGIN
action is executed.
If an awk program consists of only actions with the pattern
.Ic END
or only actions with the patterns
.Ic BEGIN
and
.Ic END ,
the input is read before the statements in the
.Ic END
actions are executed.
.Ss Built-in Variables
Variable names with special meanings:
.Bl -hang -width Va
.It Va ARGC
argument count, assignable
.It Va ARGV
argument array, assignable;
non-null members are taken as filenames
.It Va CONVFMT
conversion format used when converting numbers
(default
.Li \(dq%.6g\(dq )
.It Va ENVIRON
array of environment variables; subscripts are names.
.It Va FILENAME
the name of the current input file
.It Va FNR
ordinal number of the current record in the current file
.It Va FS
regular expression used to separate fields; also settable
by option
.Fl F Ar fs .
.It Va NF
number of fields in the current record
.It Va NR
ordinal number of the current record
.It Va OFMT
output format for numbers (default
.Li \(dq%.6g\(dq )
.It Va OFS
output field separator (default blank)
.It Va ORS
output record separator (default newline)
.It Va RS
input record separator (default newline)
.It Va RSTART
position of the first character matched by
.Fn match ;
0 if no match.
.It Va RLENGTH
length of the string matched by
.Fn match ;
\-1 if no match.
.It Va SUBSEP
separates multiple subscripts (default
.Li 034 )
.El
.Ss Functions
Functions may be defined (at the position of a pattern-action statement) thus:
.Bd -literal -offset indent
function foo(a, b, c) { ...; return x }
.Ed
.Pp
Parameters are passed by value if scalar and by reference if array name;
functions may be called recursively.
Parameters are local to the function; all other variables are global.
Thus local variables may be created by providing excess parameters in
the function definition.
.Sh EXAMPLES
Print lines longer than 72 characters.
.Fn length
defaults to
.Li $ Ns Va 0
and the empty parens can also be omitted in this case:
.Pp
.Dl length > 72
.Pp
Print first two fields in opposite order:
.Pp
.Dl { print $2, $1 }
.Pp
Same, with input fields separated by comma and/or blanks and tabs:
.Bd -literal -offset indent
BEGIN { FS = ",[ \et]*|[ \et]+" }
      { print $2, $1 }
.Ed
.Pp
Add up first column, print sum and average:
.Bd -literal -offset indent
{ s += $1 }
END { print "sum is", s, "average is", s/NR }
.Ed
.Pp
Print all lines between start/stop pairs:
.Pp
.Dl /start/, /stop/
.Pp
Simulate
.Xr echo 1 :
.Bd -literal -offset indent
BEGIN  {
        for (i = 1; i < ARGC; ++i)
        printf("%s%s", ARGV[i], i==ARGC-1?"\en":" ")
}
.Ed
.Pp
Another way to do the same that demonstrates field assignment and
.Li $ Ns Va 0
re-evaluation:
.Pp
.Dl BEGIN { for (i = 1; i < ARGC; ++i) $i = ARGV[i]; print }
.Pp
Print an error message to standard error:
.Bd -literal -offset indent
{ print "error!" > "/dev/stderr" }
.Ed
.Sh SEE ALSO
.Xr egrep 1 ,
.Xr lex 1 ,
.Xr sed 1 ,
.Xr atan2 3 ,
.Xr cos 3 ,
.Xr exp 3 ,
.Xr log 3 ,
.Xr sin 3 ,
.Xr sqrt 3 ,
.Xr strftime 3 ,
.Xr time 3
.Pp
A.\^V.\~Aho, B.\^W.\~Kernighan, P.\^J.\~Weinberger,
.Em The AWK Programming Language ,
Addison-Wesley, 1988.
ISBN 0-201-07981-X
.Pp
.Em AWK Language Programming ,
Edition 1.0, published by the Free Software Foundation, 1995
.Sh HISTORY
.Nm nawk
has been the default system
.Nm
since
.Nx 2.0 ,
replacing the previously used GNU
.Nm .
.Sh BUGS
There are no explicit conversions between numbers and strings.
To force an expression to be treated as a number add 0 to it;
to force it to be treated as a string concatenate
\&"\&" to it.
.Pp
The scope rules for variables in functions are a botch;
the syntax is worse.
.Pp
Only eight-bit characters sets are handled correctly.