On Fri, Jun 26, 2020 at 03:41:21PM -0600, Todd C. Miller wrote:
> The awk manual leaves a lot of things unspecified (buy the book ;-).
> Does this addition help clear things up?
Yes.
> Index: awk.1
> ===================================================================
> RCS file: /cvs/src/usr.bin/awk/awk.1,v
> retrieving revision 1.53
> diff -u -p -u -r1.53 awk.1
> --- awk.1 17 Jun 2020 15:34:11 -0000 1.53
> +++ awk.1 26 Jun 2020 21:39:19 -0000
> @@ -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
Given that this amends the following paragraph, your first sentence
seems repetitive:
An input line is normally made up of fields separated by whitespace, or
by the regular expression FS. The fields are denoted $1, $2, ..., while
$0 refers to the entire line. If FS is null, the input line is split
into one field per character.
How about adding something like "Therefore, FS should be set with -F or
in a BEGIN block before input is read." as second sentence in this
paragraph?