How do I make rm not give an error if a file doesn't exist?
Problem
I'm writing a makefile that will clean up some useless files at the end of the compilation. If a target has already been made, it will of course skip that target and the useless file may not be there. So if I do this: I may get errors because one of the files doesn't exist. Is there any way to tell to ignore these files? In reading the man page, I see the following option: That sounds like almost what I want, but I'm not really sure about the permissions part. Is there a way to do this?
Error Output
rm lexer.ml interpparse.ml interpparse.mli
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: How do I make rm not give an error if a file doesn't exist?
The option is definitely what you want to be using. The confirmation about file permissions it refers to is this: So will warn you if you try to delete a file you don't have write permissions on. This is allowed if you have write permissions on the directory but is a little weird, which is why normally warns you about it.
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix