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

stdbuf: incorrect exit status when command can not be invoked #7072

Closed
jfinkels opened this issue Jan 4, 2025 · 0 comments · Fixed by #7090
Closed

stdbuf: incorrect exit status when command can not be invoked #7072

jfinkels opened this issue Jan 4, 2025 · 0 comments · Fixed by #7090

Comments

@jfinkels
Copy link
Collaborator

jfinkels commented Jan 4, 2025

Environment: Ubuntu 20.04, uutils main branch (git commit 20b5365), GNU coreutils v8.30

Steps to reproduce:

$ stdbuf -o1 .

What happens now: with uutils stdbuf, the exit status is 1.

What I expected to happen: with GNU stdbuf, the exit status is 126.

Notes: this is causing a failure in the GNU test file tests/misc/stdbuf.sh.

For reference, the documentation for GNU stdbuf states

Exit status:

  • 125 if ‘stdbuf’ itself fails
  • 126 if COMMAND is found but cannot be invoked
  • 127 if COMMAND cannot be found
  • the exit status of COMMAND otherwise

Finally, for bonus points, the error message is slightly different. uutils says

stdbuf: failed to execute process: Permission denied

and GNU says

stdbuf: failed to run command ‘.’: Permission denied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant