From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 Description of problem: I believe there is a problem in gawk regular expression processing. Below is a script that reproduces the problem: #!/bin/bash # This script reproduces an apparent bug in regex processing in awk. # The problem is that interval expressions are not handled properly. # This problem occurs on RedHat 8.0. awk is packages in gawk-3.1.1-4 # The purpose of the awk script is to eliminate the first three space-delimited fields from each # input record and print the remaining contents. cat > /tmp/awkbug.dat <<EOF token1 token2 token3 token4 token1 token2 token3 token4 token5 token1 token2 token3 token4 token5 token6 token token token token4 token token token token4 token5 token6 EOF # This awk script fails ... apparently because of the interval. awk --posix '{sub(/^[ ]*([^ ]+[ ]+){3}/, "", $0); print $0}' /tmp/awkbug.dat # This awk script succeeds, but is equivalent to the one that fails. awk --posix '{sub(/^[ ]*([^ ]+[ ]+)([^ ]+[ ]+)([^ ]+[ ]+)/, "", $0); print $0}' /tmp/awkbug.dat Note that the regex's in the two invocations are equivalent, but they produce different results. Version-Release number of selected component (if applicable): gawk-3.1.1-9 How reproducible: Always Steps to Reproduce: See Description. Actual Results: [mkistler@arlab112] ~>./awkbug.sh token1 token2 token3 token4 token1 token2 token3 token4 token5 token1 token2 token3 token4 token5 token6 token token token token4 token token token token4 token5 token6 token4 token4 token5 token4 token5 token6 token4 token4 token5 token6 [mkistler@arlab112] Expected Results: Output from both invocations should be the same. Additional info:
Seems to be fixed with 3.1.3 as currently in rawhide. greetings, Florian La Roche