From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93788 invoked by alias); 12 Jul 2019 22:29:28 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 93780 invoked by uid 89); 12 Jul 2019 22:29:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1129, H*M:1c69fb81, H*M:google X-HELO: mail-oi1-f182.google.com Received: from mail-oi1-f182.google.com (HELO mail-oi1-f182.google.com) (209.85.167.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jul 2019 22:29:27 +0000 Received: by mail-oi1-f182.google.com with SMTP id w196so8433516oie.7 for ; Fri, 12 Jul 2019 15:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:to:references:subject:user-agent; bh=wjJ3fcJvWpekTTKsZqv1W3owaI5Ycw6LweI9MIHNe30=; b=ea/2zn0Cps2NggBm/esNKhrZJxcSIlme8ZEYTHR3BfLW2/syzF0PgbbPuceAr7DwBg OifissTMYktdPleBGfAKu6o6lR54O92K1YtY70bMSC3meF2I4YYtzFu/BgBbGWxZ2pEY j6gYa8p3F9z09eLbUS0IHIqbxHlUphs10EENAazMhnbBxTcrf63T3QAvFuKZKLI8qatj Bd+ViDuTnRuDawWLDtFU+/PCMbjPU5QA3gQUaPR89jdVkREN0wl/U2NellGNqAcZsuk5 ga2vXlE95G20FBF2ek5uI5hk+axAtYw4gxJUr+lYBSVMLZup6RO7Smvb8RLLFjF5J8Cx eQWg== Return-Path: Received: from 6eU ([2605:6000:9fc0:56:6045:8f05:def0:5b7]) by smtp.gmail.com with ESMTPSA id z26sm4019679ote.40.2019.07.12.15.29.24 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 15:29:24 -0700 (PDT) Message-ID: <5d2909c4.1c69fb81.acce9.cde9@mx.google.com> Date: Fri, 12 Jul 2019 22:29:00 -0000 From: Steven Penny To: cygwin@cygwin.com References: Subject: Re: Possible issue with gawk 5.0.1-1: Getting new warnings Content-Type: text/plain; charset=utf8; format=flowed User-Agent: Suede Mail/2.8.0 (cup.github.io/suede/mail) X-SW-Source: 2019-07/txt/msg00103.txt.bz2 On Thu, 11 Jul 2019 11:51:09, Vipul P wrote: > Here is a sample script to invoke awk: > > $ cat ./gawk_error.sh > #!/bin/sh > echo "This:is:a:colon:separated:line:%%%:" | awk '{ > gsub("\\%", "%25", $0); > gsub("\\:", "%3A", $0); > print > }' As others said, your invocation is not idiomatic AWK. Anywhere that regular expressions are expected, like the first argument to "gsub", regular expressions should be used. If you use a string, you need an extra level of escaping, as the AWK lexer will parse the string twice: > If the right-hand operand is any expression other than the lexical token > **ERE**, the string value of the expression shall be interpreted as an > extended regular expression, including the escape conventions described > above. Note that these same escape conventions shall also be applied in > determining the value of a string literal (the lexical token **STRING**), > and thus shall be applied a second time when a string literal is used in > this context. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html#tag_20_06_13_04 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple