summaryrefslogtreecommitdiff
path: root/usr.bin/awk/awk.1
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2020-06-26 21:50:07 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2020-06-26 21:50:07 +0000
commit1ab994bbf682b08a9c258529973f3502bd33ecbe (patch)
treebb3b413ac87d9844e25d6c6f210dbbfaedbe5474 /usr.bin/awk/awk.1
parent4e813f4505b7bd19f479649fc8a052ddd4445189 (diff)
Document that FS is applied at the time the input line is read.
Previously, our awk suffered from a bug where FS was applied too late. This fix has the potential to cause problems for awk scripts written to the old (buggy) behavior. The current behavior is consistent with other awk implementations such as mawk and gawk.
Diffstat (limited to 'usr.bin/awk/awk.1')
-rw-r--r--usr.bin/awk/awk.114
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/awk/awk.1 b/usr.bin/awk/awk.1
index 12e752b70b6..ee2f8dc8ca8 100644
--- a/usr.bin/awk/awk.1
+++ b/usr.bin/awk/awk.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: awk.1,v 1.53 2020/06/17 15:34:11 tim Exp $
+.\" $OpenBSD: awk.1,v 1.54 2020/06/26 21:50:06 millert Exp $
.\"
.\" Copyright (C) Lucent Technologies 1997
.\" All Rights Reserved
@@ -22,7 +22,7 @@
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
.\" THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 17 2020 $
+.Dd $Mdocdate: June 26 2020 $
.Dt AWK 1
.Os
.Sh NAME
@@ -140,6 +140,16 @@ refers to the entire line.
If
.Va FS
is null, the input line is split into one field per character.
+Lines are split into fields using the value of
+.Va FS
+at the time the line is read.
+Because of this,
+.Va FS
+is usually set via the
+.Fl F
+option or inside of a
+.Ic BEGIN
+block.
.Pp
Normally, any number of blanks separate fields.
In order to set the field separator to a single blank, use the