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 16215 invoked from network); 29 Nov 2022 15:18:34 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2022 15:18:34 -0000 Received: from wopr.sciops.net ([216.126.196.60]) by 9front; Tue Nov 29 10:15:06 -0500 2022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sciops.net; s=20210706; t=1669734893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qXq2i+uKwy1rL/19IbrSW9h/Hec+NM7htAotYZqDo7Y=; b=MtB0SPw2eB1Uc+o1+QIDjJ+W5rxzuRRhjIS+mAJYFpWuWtX4WhjrUQXJ4gqrUf4BcuXVjl jItmnRqDTCEPR2UA00K4eoj5mgCU89iMQ/pc58BBC7Dntzh5yH0xovE+VTgmk+WX3Lqqi7 U2YZRbjivG39ysxqR/j6g3MeU+zlBU4= Received: from localhost (wopr.sciops.net [local]) by wopr.sciops.net (OpenSMTPD) with ESMTPA id b0884df1 for <9front@9front.org>; Tue, 29 Nov 2022 07:14:53 -0800 (PST) Date: Tue, 29 Nov 2022 07:14:53 -0800 From: Kurt H Maier To: 9front@9front.org Message-ID: Mail-Followup-To: 9front@9front.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: self-healing injection general-purpose service Subject: Re: [9front] [PATCH] awk(1): quote argument for -v option Reply-To: 9front@9front.org Precedence: bulk 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