[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Awk gets stucked if no filename
From: |
Neil R. Ormos |
Subject: |
Re: [bug-gawk] Awk gets stucked if no filename |
Date: |
Thu, 21 Jun 2018 13:18:59 -0500 (CDT) |
Arnold Robbins wrote:
> ["Neil R. Ormos" <address@hidden> wrote:]
>> [... mis-understanding the behavior of the shell ...]
> Hi.
> I am going through old mail. I may never have answered
> this, I don't remember.
> See below.
> [...]
> In the case under discussion:
> f=""
> awk '{ print("hi") }' $f
> awk doesn't see an explicit empty string. When a variable
> expansion is the null string, AND it's not quoted, the
> shell simply removes it from the command line. To demonstrate:
> $ f=""
> $ awk 'BEGIN { print ARGC }' $f
> 1
> $ awk 'BEGIN { print ARGC }' "$f"
> 2
Arnold:
You replied contemporaneously, but I appreciate
the opportunity to revisit the topic today and
re-learn subject matter about which I had erred
when I earlier posted.
Thanks.
Best regards,
--Neil Ormos