xargs: empty items are dropped with -0 and -d
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start by locating the xargs implementation and its handling of -0 and -d byte-delimited input. Reproduce the commands in this report, then trace how delimiters at the beginning or next to another delimiter are parsed. Done means empty items reach the command, including with -n1 and -r, while non-byte-delimited behavior remains unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
With -0 or -d, uutils xargs drops an empty input item when a delimiter appears at the start of the input or immediately after another delimiter.
$ printf 'a\0\0b\0' | xargs -0 printf '[%s]\n'
[a]
[b]
GNU findutils 4.11.0 passes the empty item to the command:
[a]
[]
[b]
The same problem occurs with explicit delimiters, including:
printf 'a,,b,' | xargs -d, printf '[%s]\n'
printf 'a\n\nb\n' | xargs -d '\n' printf '[%s]\n'
Dropping the item also changes the behavior of options that count arguments. For example, GNU runs test -n '' here and exits 123, while uutils skips that invocation and exits 0:
printf 'a\0\0b\0' | xargs -0 -n1 test -n
Likewise, printf '\0' | xargs -0 -r printf '[%s]\n' prints [] with GNU but runs nothing with uutils.
This is specific to byte-delimited input. Without -0 or -d, empty lines do not become empty arguments.
Tested on Linux x86_64 against GNU findutils 4.11.0.
- Lenguaje dominante
- Rust
- Estrellas
- 651
- Forks
- 111
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 21
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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/findutils
-
-printf %m and -ls drop setuid/setgid/sticky bits and the file typePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
uutils/findutils#692 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
find on Windows: opt in to / as the path separatorPosiblemente ocupada @mutewinter la tomó hace 6 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
xargs: -x runs a pending command before rejecting an oversized argumentPosiblemente ocupada @SichenLiang la tomó hace 8 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 28/100
Los mantenedores suelen responder en 1 día
-
find: -ls shows the time instead of the year for old filesPosiblemente ocupada @SichenLiang la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 32/100
Los mantenedores suelen responder en 1 día
Todos los issues de uutils/findutils
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
chrisdickinson/trivia#26 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100