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

coreutils {pr,truncate} --do-not-exist error code is 1 instead of 2 #3371

Closed
sylvestre opened this issue Apr 5, 2022 · 2 comments
Closed

Comments

@sylvestre
Copy link
Contributor

example:

$ ./target/debug/coreutils ls --do-not-exist 2> /dev/null; echo $?   
2

but

$ ./target/debug/coreutils pr --do-not-exist 2> /dev/null; echo $?  
1
$ ./target/debug/coreutils cp --do-not-exist 2> /dev/null; echo $?
1
$ ./target/debug/coreutils truncate --do-not-exist 2> /dev/null; echo $?
1

See also
#3331

@sylvestre sylvestre changed the title coreutils {cp,pr,truncate} --do-not-exist error code is 1 instead of 2 coreutils {cp,pr,truncate} --do-not-exist error code is 1 instead of 2 Apr 5, 2022
sylvestre added a commit to sylvestre/coreutils that referenced this issue Apr 5, 2022
sylvestre added a commit to sylvestre/coreutils that referenced this issue Apr 5, 2022
sylvestre added a commit to sylvestre/coreutils that referenced this issue Apr 5, 2022
sylvestre added a commit to sylvestre/coreutils that referenced this issue Apr 5, 2022
@tertsdiepraam
Copy link
Member

This matches GNU behaviour:

$ cp --does-not-exist 2> /dev/null; echo $?
1

So if we want to change this, it would be an explicit incompatibility with GNU

@sylvestre sylvestre changed the title coreutils {cp,pr,truncate} --do-not-exist error code is 1 instead of 2 coreutils {pr,truncate} --do-not-exist error code is 1 instead of 2 Apr 6, 2022
@sylvestre
Copy link
Contributor Author

oh, cool.
So, the bug will be closed by my PR then

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

No branches or pull requests

2 participants