awk(1): Another echo(1) example that demonstrates field assignment

This commit is contained in:
uwe 2022-07-05 17:58:47 +00:00
parent 3fd9f4ec12
commit aa708eb2ec
1 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: awk.1,v 1.26 2022/07/05 16:59:41 uwe Exp $
.\" $NetBSD: awk.1,v 1.27 2022/07/05 17:58:47 uwe Exp $
.\"
.\" Copyright (C) Lucent Technologies 1997
.\" All Rights Reserved
@ -788,6 +788,12 @@ BEGIN {
}
.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" }