delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/07/12/18:30:17

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:to:references:subject
:content-type; q=dns; s=default; b=lWNoOT4Kcf2HXQCD+pND0JlNhf30x
664+XPqnVVL22FMIx6gIqOdFtQbbNQ/Rq/g2K23JhO39K+1df2J0uPwQCrXxeroP
7Zxw7kvFOdOL3554cGrK4Z+TAhykUUONg4oM0JbOG/VDMdAXlWifz2PZYIScb1sq
62rJEhemnyMHCM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:to:references:subject
:content-type; s=default; bh=iI8sGcgMfjhoyW2hC20vVbohSZ8=; b=Vra
l2JUcWnYjEuQhUUu5lVWD3bG2Xf+wREqSH1eCX6wtN5d5sMFABAqRCVOtY1x7MX3
QiqQhEF1XeoxL4ul10M9ZgKKJODFKYzDaiZYNI/4kbPUwi6bPWIFrP0f35RnXpQ4
zBkr1IBfX0zG1Uk7C4ENbLgmszvbJP5a1Sj0hmPE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
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==
Message-ID: <5d2909c4.1c69fb81.acce9.cde9@mx.google.com>
Date: Fri, 12 Jul 2019 15:29:24 -0700 (PDT)
From: Steven Penny <svnpenn AT gmail DOT com>
To: cygwin AT cygwin DOT com
References: <CAGtwZuYLXDHFiAHGVYw8s+jqt0bNtGMpy+6fOSiqjZddazXZew AT mail DOT gmail DOT com>
Subject: Re: Possible issue with gawk 5.0.1-1: Getting new warnings
User-Agent: Suede Mail/2.8.0 (cup.github.io/suede/mail)

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019