Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

head: fails to leave remaining bytes of file available for subsequent commands #7028

Open
jfinkels opened this issue Dec 29, 2024 · 0 comments
Labels

Comments

@jfinkels
Copy link
Collaborator

Environment: Ubuntu 20.04, uutils main branch (git commit dddbc17), GNU coreutils v9.5.218-7e5b6.

Steps to reproduce:

printf "a\nb\n" > f
(head -n1 >/dev/null; cat) < f

What happens now: uutils head outputs nothing.

What I expected to happen: GNU head outputs b\n, as expected.

Notes: this is causing a failure in the GNU test file tests/head/head-pos.sh.

We ran into a similar issue with dd here #3008 which was fixed by opening the file from its raw file descriptor here #4189. Maybe a similar solution can be applied to this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant