From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13683 invoked from network); 29 Nov 2022 14:55:06 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2022 14:55:06 -0000 Received: from gaff.inri.net ([168.235.71.243]) by 9front; Tue Nov 29 09:53:21 -0500 2022 Received: from smtpclient.apple ([104.59.85.219]) by gaff; Tue Nov 29 09:53:21 -0500 2022 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Stanley Lieber Mime-Version: 1.0 (1.0) Message-Id: References: In-Reply-To: To: 9front@9front.org Date: Tue, 29 Nov 2022 09:52:40 -0500 X-Mailer: iPhone Mail (20B101) List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: open JSON GPU element interface Subject: Re: [9front] [PATCH] awk(1): quote argument for -v option Reply-To: 9front@9front.org Precedence: bulk this is an rc quirk, not related to awk. for example, what if you run awk fr= om the ape/sh (or some other) shell? on the other hand, obviously in almost every case the user will be launching= awk from rc. still, i do not think we need to document rc quoting behavior in every man p= age because ultimately the man page is for the program in question, while rc= quoting is something a 9front user will have to come to terms with early in= their career as a 9front. in summary, rc=E2=80=99s quoting is not a universal condition, so it should r= emain implied rather than explicit in man pages that are not the rc man page= . sl > On Nov 29, 2022, at 7:11 AM, Anders Damsgaard wrote= : >=20 > =EF=BB=BFDear all, >=20 > Running awk from rc, I found that I need to quote the arguments to awk's > -v option, as in: >=20 > awk -v 'myvar=3Dasdf' 'BEGIN{print myvar}' >=20 > However, the awk man page specifies this without quotes as "awk -v > myvar=3Dasdf". I now realize that it will not work without quotes because= > rc tries to interpret the assignment operator. >=20 > Is this just a beginner mistake, being used to unix behavior, or worth > documenting as in the patch below? >=20 > Thanks, Anders >=20 >=20 > diff ff2ebe6cfdacd890a74a6d2f9b0acd062d2633b7 uncommitted > --- a/sys/man/1/awk > +++ b/sys/man/1/awk > @@ -23,7 +23,7 @@ > ] > [ > .B -v > -.I var=3Dvalue > +.I 'var=3Dvalue' > ] > [ > .B -f > @@ -58,13 +58,13 @@ > Any > .IR file > of the form > -.I var=3Dvalue > +.I 'var=3Dvalue' > is treated as an assignment, not a file name, > and is executed at the time it would have been opened if it were a file na= me. > The option > .B -v > followed by > -.I var=3Dvalue > +.I 'var=3Dvalue' > is an assignment to be done before the program > is executed; > any number of >=20