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, NICE_REPLY_A autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 24384 invoked from network); 29 Nov 2022 16:31:26 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2022 16:31:26 -0000 Received: from mail.posixcafe.org ([45.76.19.58]) by 9front; Tue Nov 29 11:30:26 -0500 2022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posixcafe.org; s=20200506; t=1669739577; 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=vNjNtpe7dJ4zQYonUwZqO8Sw2b0f7C+nbEsyyfKYw98=; b=E82s89mHLu01LoPlpabgmM3KLeABbI5dcCRWEq5ae6iFEhqUod8YiVhXh2lvATfGezmZUv MsewYawi0OIlSww3+1cpNFDMrTDaN1NgdjnrO433dlC2Ve3t7JfLXGRv7iRdxNUCqH+jY5 PSpudmLa+zoJkeVOxwrEpY6hO87RPPU= Received: from [192.168.168.200] (161-97-205-25.mynextlight.net [161.97.205.25]) by mail.posixcafe.org (OpenSMTPD) with ESMTPSA id 97b703a9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <9front@9front.org>; Tue, 29 Nov 2022 10:32:57 -0600 (CST) Message-ID: <2f69e1e8-907b-59b4-7249-75a4435d9041@posixcafe.org> Date: Tue, 29 Nov 2022 09:28:04 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: 9front@9front.org References: From: Jacob Moody In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: proxy-scale storage-aware just-in-time shader template element backend Subject: Re: [9front] [PATCH] awk(1): quote argument for -v option Reply-To: 9front@9front.org Precedence: bulk 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.