Fields that look like numbers compare as strings
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start with the three one-liners in the report and confirm the byte-wise comparison. Then find where AwkValue::StrNum is defined and where record fields are turned into plain strings, since the report says nothing creates StrNum yet. Agree on the approach with the maintainers before editing, because the report asks whether StrNum is the intended design. Done when the three commands match gawk and fields like 1.0 and 50 compare numerically.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
$1 > 100 keeps 50, and $1 == 1 drops 1.0:
$ printf '50 150\n1.0 2\n10 9\n' | awk '$1 > 100'
50 150
$ printf '50 150\n1.0 2\n10 9\n' | awk '$1 == 1'
$ printf '50 150\n1.0 2\n10 9\n' | awk '$1 < $2'
1.0 2
10 9
gawk 5.3.2, mawk and nawk print nothing, 1.0 2, and 50 150 / 1.0 2.
POSIX makes a field that looks like a number a numeric string, so it compares numerically with a number or with another numeric string. Here every field is a plain string (typeof($2) on x 10 prints string; gawk prints strnum), so these comparisons are done byte by byte. The same rule covers getline var, split() elements, ARGV, ENVIRON and -v values.
AwkValue::StrNum exists but nothing creates it yet, so this looks like the planned place for it. Is that the plan? I can send a PR for fields if a direction is agreed.
Checked on main 8f8cf8d.
- Lenguaje dominante
- Rust
- Estrellas
- 31
- Forks
- 13
- Merge medio
- 23 h 42 min
- PR fusionados (30 d)
- 29
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de uutils/awk
-
bug gnu-compat good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug crash gnu-compat good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug gnu-compat good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
awk: ARGV and ARGC are never setAbiertobug gnu-compat good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
awk: `-f missing-file` and `--source` panicPosiblemente ocupada @VanshajPoonia la tomó hace 4 días. Abiertobug crash gnu-compat good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
Todos los issues de uutils/awk
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
code-quality parser
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
eventflux-io/eventflux#218 ·
Los mantenedores suelen responder en 1 día
-
StartSso docs say an option requires the built-in AuthnRequest renderer, which is now the only oneAbiertodocumentation needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
marketing
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día