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.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 26252 invoked from network); 29 Nov 2022 16:45:28 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2022 16:45:28 -0000 Received: from wopr.sciops.net ([216.126.196.60]) by 9front; Tue Nov 29 11:43:52 -0500 2022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sciops.net; s=20210706; t=1669740223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9/fgBLsKqkm/V/MIz3DXc+L6I3whVZCHANogeD97Mzo=; b=ylHUqNXW22CJVzt8YtOAent2PtAmrgFUw0OqjCD23P5k2rz8nsj7D5hBkRUH91ndWVEfDi OmWxqyYdu9HgWY84quGkh9D+PVO+qLrM63H270F00N/9Wq5lJD0fSA9o3U0jT9yeNUJjsv dZh8phpwJtUNTOal8VU4jabqFqV9VkI= Received: from localhost (wopr.sciops.net [local]) by wopr.sciops.net (OpenSMTPD) with ESMTPA id 80a146e6 for <9front@9front.org>; Tue, 29 Nov 2022 08:43:43 -0800 (PST) Date: Tue, 29 Nov 2022 08:43:43 -0800 From: Kurt H Maier To: 9front@9front.org Message-ID: Mail-Followup-To: 9front@9front.org References: <2f69e1e8-907b-59b4-7249-75a4435d9041@posixcafe.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2f69e1e8-907b-59b4-7249-75a4435d9041@posixcafe.org> List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: scale-out grid Subject: Re: [9front] [PATCH] awk(1): quote argument for -v option Reply-To: 9front@9front.org Precedence: bulk On Tue, Nov 29, 2022 at 09:28:04AM -0700, Jacob Moody wrote: > On 11/29/22 09:24, Sigrid Solveig Hafl�nud�ttir wrote: > > Quoth Kurt H Maier : > >> On Tue, Nov 29, 2022 at 01:10:26PM +0100, Anders Damsgaard wrote: > >>> Dear all, > >>> > >>> Running awk from rc, I found that I need to quote the arguments to awk's > >>> -v option, as in: > >>> > >>> awk -v 'myvar=asdf' 'BEGIN{print myvar}' > >>> > >>> However, the awk man page specifies this without quotes as "awk -v > >>> myvar=asdf". I now realize that it will not work without quotes because > >>> rc tries to interpret the assignment operator. > >>> > >>> Is this just a beginner mistake, being used to unix behavior, or worth > >>> documenting as in the patch below? > >>> > >>> Thanks, Anders > >> > >> I guess I'll be that guy again > >> > >> I know that the quoting quirk is a characteristic of rc and not whatever > >> other environment one might conceivably use to launch awk. I get that > >> under most unix shells this is a non-issue. However, the quoted variant > >> also works fine in e.g. bash and ksh and so forth. It's all the same to > >> awk. > >> > >> I submit as my actual argument that having documentation containing > >> examples which, when copied and pasted into the primary UI of the > >> project, do not work, is bad form. People read man pages to learn how > >> to use shit, not to get a sense of the general aesthetic of a given > >> command were we to run it on v7 Unix. The shit we say should work > >> should work. > >> > >> I vote the patch goes in. > >> > >> khm > > > > Wasn't there a patch somewhere for Plan 9 Port(??) that made the > > quoting a bit more relaxed when NOT specifying env vars? I'd be more > > inclined to accept non-quoted variant in parameters. Having to quote > > those is annoying, I want the computer to figure out what I'm doing, > > not to baby-sit rc. > > > > > That there was, I believe it came with the work that was done in rewriting > the parser away from yacc. I would second this change. > previously discussed in the thread 'new rc parser: do we want it?' in this mailing list. also related: https://www.mail-archive.com/9fans@9fans.net/msg36493.html khm