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 25135 invoked from network); 29 Nov 2022 12:12:30 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2022 12:12:30 -0000 Received: from mx1.adamsgaard.dk ([46.23.94.178]) by 9front; Tue Nov 29 07:10:36 -0500 2022 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=20210624; bh=hYSyubxFkuX uFU3oA46rH/SDe0PfL6GuFC8Ou5S92LQ=; h=subject:to:from:date; d=adamsgaard.dk; b=fF6LBwo8E2lstCUpF0HzTfR6KhJr1oE+i1+AbRPhg+VavcYCyuS McV00X7fVK/je1HDRSr0AALAcCKyMkdDDKOh2CxFLM2+wlg11e+JfOp98UUDfOmKmL49JH acYjdQW1I/l96Qx9qmK+KP/gVdmcFnG7PX+7xe4AveG+W54Ug6N9CF6tPk1VB47FEjhoyw uKQ9/8cr0BBvorzkRLUOdE3MdVLWpIcSxphlKhjmyJCGqELbalp0a368PE2Q2kqlbKrtVX CCUJwN/4XeL+Lkx5at1ge64flkH4sCel2b7WNO4db36pzIJTGeHCEImZ4Vvzipf03z7r+T 2qRB9gjU3Iw== Received: from x1.home (176-23-48-220-cable.dk.customer.tdc.net [176.23.48.220]) by mx1.adamsgaard.dk (OpenSMTPD) with ESMTPSA id 1de482ac (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <9front@9front.org>; Tue, 29 Nov 2022 13:10:27 +0100 (CET) Received: from localhost (x1.home [local]) by x1.home (OpenSMTPD) with ESMTPA id 2495df55 for <9front@9front.org>; Tue, 29 Nov 2022 12:10:26 +0000 (UTC) Date: Tue, 29 Nov 2022 13:10:26 +0100 From: Anders Damsgaard To: 9front@9front.org Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: virtual configuration HTML over ACPI full-stack content-driven-scale component Subject: [9front] [PATCH] awk(1): quote argument for -v option Reply-To: 9front@9front.org Precedence: bulk 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 diff ff2ebe6cfdacd890a74a6d2f9b0acd062d2633b7 uncommitted --- a/sys/man/1/awk +++ b/sys/man/1/awk @@ -23,7 +23,7 @@ ] [ .B -v -.I var=value +.I 'var=value' ] [ .B -f @@ -58,13 +58,13 @@ Any .IR file of the form -.I var=value +.I 'var=value' 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 name. The option .B -v followed by -.I var=value +.I 'var=value' is an assignment to be done before the program is executed; any number of