[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] gawk 4.1.3 gensub() warning

From: arnold
Subject: Re: [bug-gawk] gawk 4.1.3 gensub() warning
Date: Thu, 03 Sep 2015 06:34:42 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Ed Morton <address@hidden> wrote:

> I'm seeing this new warning in gawk 4.1.3 executing existing scripts:
> $ echo 'a' | gawk '{print gensub(/a/,"b","")}'
> gawk: cmd. line:1: (FILENAME=- FNR=1) warning: gensub: third argument `' 
> treated 
> as 1
> b
> This will impact a ton of scripts, like if sed suddenly started issuing 
> warnings 
> if you wrote `s/foo/bar/` instead of `s/foo/bar/1`. Is it here to stay?
>      Ed.

The warning is indeed here to stay. Use of "" is wrong; you should
supply a numeric 1 there.  Fix your scripts.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]