| 1 |
# Date: Sun, 4 May 2014 18:09:01 +0200 |
| 2 |
# From: Davide Brini <[email protected]> |
| 3 |
# To: [email protected] |
| 4 |
# Subject: Re: [bug-gawk] Computed regex and getline bug / issue |
| 5 |
# |
| 6 |
# I have been able to reduce the behavior to these simple test cases, which |
| 7 |
# (unless I'm missing something obvious) should behave identically but don't: |
| 8 |
# |
| 9 |
# $ printf '1,2,' | gawk 'BEGIN{RS="[,]+"}{print; a = getline; print "-"a"-"; print}' |
| 10 |
# 1 |
| 11 |
# -0- |
| 12 |
# 1 |
| 13 |
|
| 14 |
BEGIN { |
| 15 |
RS = "[,]+" |
| 16 |
} |
| 17 |
|
| 18 |
{ |
| 19 |
printf "[%s] [%s]\n", $0, RT |
| 20 |
a = getline |
| 21 |
print "-"a"-" |
| 22 |
printf "[%s] [%s]\n", $0, RT |
| 23 |
} |