[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Docs: Clarify that accessing field beyond the last one throws lint w
From: |
Sebastian Carlos |
Subject: |
Re: Docs: Clarify that accessing field beyond the last one throws lint warning. |
Date: |
Mon, 12 Jun 2023 19:33:25 +0200 |
> except that $NR is the last (existing) field
‘NR’ is the number of records read so far. `NF` is the number of fields.
On Mon, Jun 12, 2023 at 7:02 PM david kerns <david.t.kerns@gmail.com> wrote:
>
>
> On Mon, Jun 12, 2023 at 9:14 AM Sebastian Carlos <sebaaa1754@gmail.com>
> wrote:
>
>> I think this is significant because the next section of the docs even has
>> an example
>> that would show that warning if running it with the linter on:
>>
>> > awk '{ print $NR }'
>>
>> except that $NR is the last (existing) field ... $0 is the whole record
> (line) and $1 is the first field
> awk '{print $(NR+1)}'
> is the first non-existing field ... and hopefully, should not print a
> warning by default
>
>