[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: |
david kerns |
Subject: |
Re: Docs: Clarify that accessing field beyond the last one throws lint warning. |
Date: |
Mon, 12 Jun 2023 10:02:25 -0700 |
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