bug-gnu-utils
[Top][All Lists]
Advanced

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

possible gsub() bug


From: Teemu Ikonen
Subject: possible gsub() bug
Date: Fri, 23 Apr 2004 13:25:46 +0300
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)


Hi,

gsub seems to do incorrect substitution in some cases.

Example script (example.awk)
============================

BEGIN {
  IGNORECASE=0;
}

{
     gsub("[A-Z][A-Z]*:","");
     print $0;
}


Exaple run:
===========

elaboration /tmp $ gawk -f example.awk
ID:address@hidden:1234       <--- input from console
address@hidden
ID:address@hidden:1234    <--- input from console
address@hidden

I would expect to see:
======================

elaboration /tmp $ gawk -f example.awk
ID:address@hidden:1234       <--- input from console
address@hidden:1234
ID:address@hidden:1234    <--- input from console
address@hidden:1234



System inforamtion:

elaboration /tmp $ uname -a
Linux elaboration.firsthop.fi 2.4.22-1.2174.nptl #1 Wed Feb 18 16:38:32 EST 2004 i686 i686 i386 GNU/Linux

elaboration /tmp $ cat /etc/issue
Fedora Core release 1 (Yarrow)
Kernel \r on an \m

elaboration /tmp $ rpm -qif /bin/gawk
Name        : gawk                         Relocations: (not relocateable)
Version     : 3.1.3                             Vendor: Red Hat, Inc.
Release : 3 Build Date: Mon 22 Sep 2003 04:58:49 PM EEST Install Date: Mon 16 Feb 2004 05:21:23 PM EET Build Host: porky.devel.redhat.com
Group       : Applications/Text             Source RPM: gawk-3.1.3-3.src.rpm
Size        : 4473346                          License: GPL
Signature : DSA/SHA1, Wed 29 Oct 2003 02:13:34 AM EET, Key ID b44269d04f2a6fd2
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary     : The GNU version of the awk text processing utility.
Description :
The gawk packages contains the GNU version of awk, a text processing
utility. Awk interprets a special-purpose programming language to do
quick and easy text pattern matching and reformatting jobs.

Install the gawk package if you need a text processing utility. Gawk is
considered to be a standard Linux tool for processing text.
elaboration /tmp $


____________________________________________________________________
Teemu Ikonen             First Hop Ltd          GSM +358 40 703 5561
Head R&D Engineer        Tammasaarenlaituri 3   fax +358 10 286 6450
address@hidden       FIN-00180 HELSINKI     tel +358 10 286 6440
------------------- May the source be with you ---------------------




reply via email to

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