From 501c2e5e720e3dbcb2e830c28037dd8b8d46bfcf Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 30 May 2015 23:42:51 -0400 Subject: Improve handling and doc of compl(). --- doc/gawk.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/gawk.texi') diff --git a/doc/gawk.texi b/doc/gawk.texi index 18ef080b..57a2f893 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -19175,7 +19175,7 @@ $ @kbd{gawk -f testbits.awk} @print{} 123 = 01111011 @print{} 0123 = 01010011 @print{} 0x99 = 10011001 -@print{} compl(0x99) = 0xffffff66 = 11111111111111111111111101100110 +@print{} compl(0x99) = 0x3fffffffffff66 = 00111111111111111111111111111111111111111111111101100110 @print{} lshift(0x99, 2) = 0x264 = 0000001001100100 @print{} rshift(0x99, 2) = 0x26 = 00100110 @end example -- cgit v1.2.3 From 72882c6a1e76730e6e706941a1a3a855ea023b69 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 31 May 2015 12:04:23 -0400 Subject: POSIX now allows \n for default field splitting. Fix code and doc. --- doc/gawk.texi | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'doc/gawk.texi') diff --git a/doc/gawk.texi b/doc/gawk.texi index df53c97d..c2c1f469 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -4132,11 +4132,6 @@ restrictions apply: @cindex newlines @cindex whitespace, newlines as -@item -Newlines do not act as whitespace to separate fields when @code{FS} is -equal to a single space -(@pxref{Fields}). - @item Newlines are not allowed after @samp{?} or @samp{:} (@pxref{Conditional Exp}). @@ -6730,16 +6725,12 @@ Readfile} for another option. @cindex fields @cindex accessing fields @cindex fields, examining -@cindex POSIX @command{awk}, field separators and -@cindex field separators, POSIX and -@cindex separators, field, POSIX and When @command{awk} reads an input record, the record is automatically @dfn{parsed} or separated by the @command{awk} utility into chunks called @dfn{fields}. By default, fields are separated by @dfn{whitespace}, like words in a line. Whitespace in @command{awk} means any string of one or more spaces, -TABs, or newlines;@footnote{In POSIX @command{awk}, newlines are not -considered whitespace for separating fields.} other characters +TABs, or newlines; other characters that are considered whitespace by other languages (such as formfeed, vertical tab, etc.) are @emph{not} considered whitespace by @command{awk}. @@ -7184,7 +7175,6 @@ can massage it first with a separate @command{awk} program.) @node Default Field Splitting @subsection Whitespace Normally Separates Fields -@cindex newlines, as field separators @cindex whitespace, as field separators Fields are normally separated by whitespace sequences (spaces, TABs, and newlines), not by single spaces. Two spaces in a row do not @@ -14720,12 +14710,11 @@ specify the behavior when @code{FS} is the null string. Nonetheless, some other versions of @command{awk} also treat @code{""} specially.) -@cindex POSIX @command{awk}, @code{FS} variable and The default value is @w{@code{" "}}, a string consisting of a single -space. As a special exception, this value means that any -sequence of spaces, TABs, and/or newlines is a single separator.@footnote{In -POSIX @command{awk}, newline does not count as whitespace.} It also causes -spaces, TABs, and newlines at the beginning and end of a record to be ignored. +space. As a special exception, this value means that any sequence of +spaces, TABs, and/or newlines is a single separator. It also causes +spaces, TABs, and newlines at the beginning and end of a record to +be ignored. You can set the value of @code{FS} on the command line using the @option{-F} option: @@ -36848,6 +36837,14 @@ is now two. Nonfatal output with @code{print} and @code{printf}. @xref{Nonfatal}. +@item +For many years, POSIX specified that default field splitting +only allowed spaces and tabs to separate fields, and this was +how @command{gawk} behaved with @option{--posix}. As of 2013, +the standard restored historical behavior, and now default +field splitting with @option{--posix} also allows newlines to +separate fields. + @item Support for MirBSD was removed. @end itemize -- cgit v1.2.3