trash icon indicating copy to clipboard operation
trash copied to clipboard

-f exits with non-zero error code

Open paleite opened this issue 6 years ago • 1 comments

I don't know if it's intentional or not, but trash (unlike rm) exits with a non-zero error code for non-existent files when using it with the -f flag.

The man-page for rm says the following for the -f-flag:

If the file does not exist, do not display a diagnostic message or modify the exit status to reflect an error.

Example:

$ rm -f imaginary-file && echo "done"
done
$ trash -f imaginary-file && echo "done"
trash: imaginary-file: path does not exist

paleite avatar Apr 10 '19 15:04 paleite

This is indeed problematic!

twardoch avatar Apr 10 '21 11:04 twardoch