Thread View: gnu.utils.bug
2 messages
2 total messages
Started by Marty
Thu, 10 Aug 1989 15:47
gawk bug?
Author: Marty
Date: Thu, 10 Aug 1989 15:47
Date: Thu, 10 Aug 1989 15:47
37 lines
1143 bytes
1143 bytes
I seem to have tripped over something. I have nothing to compare to (this
won't run on old awk) and I haven't found anything in the documentation to
cover this case.
RLENGTH -1 works differently than RLENGTH - 1.
Example:
{
match($0, "this is a bug")
pattern = substr($0, RSTART, RLENGTH )
bad = substr($0, RSTART+1, RLENGTH -1)
good = substr($0, RSTART+1, RLENGTH - 1)
print "found pattern " pattern
print "bad = " bad
print "good = " good
}
Input='this is a bug, trying out awk'
Output:
gawk -f bug.awk bug.tst
found pattern this is a bug
bad = his is a bug,
good = his is a bug
Problem: the comma at the end of bad shouldn't (??) be there.
What's the story on this?
marty
ARPA: leisner.henr@xerox.com
GV: leisner.henr
NS: leisner:wbst139:xerox
UUCP: hplabs!arisia!leisner
Re: gawk bug?
Author: Arnold D. Robbins {EUCC}
Date: Fri, 11 Aug 1989 16:39
Date: Fri, 11 Aug 1989 16:39
10 lines
966 bytes
966 bytes
In article <890810-084721-6771@Xerox> Leisner.Henr@XEROX.COM (Marty) writes: >RLENGTH -1 works differently than RLENGTH - 1. This is a gawk bug; in the former case gawk thought it had a concatenation. It should be fixed in 2.11. -- Arnold Robbins -- Emory University Computing Center | Laundry increases DOMAIN: arnold@unix.cc.emory.edu | exponentially in the UUCP: gatech!emoryu1!arnold PHONE: +1 404 727-7636 | number of children. BITNET: arnold@emoryu1 FAX: +1 404 727-2599 | -- Miriam Hartholz
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads