How to make sure that a file is deleted with one command? #866
Labels
community-upvoted
enhancement
New feature or request
priority-medium
Not functioning - next quarter if capacity permits
Milestone
I am trying to delete a file that may not exist.
In Linux, I would use
rm -f /tmp/may-not-exist
and that would either delete it if it is there or not delete without any error message and error code if it is already deleted.The man page of
rm
says:This is a useful option because I do not need to check if the file is deleted before I am deleting and it leads to simple and more stable automation (because the file can be deleted outside of my script after the check).
The Zowe CLI has
-f
option that has a different meaning. If the file does not exist, Zowe CLI fails with an error.It would be useful to have a similar option
-f
as Linuxrm
has so it returns 0 when the file does not exist.The current behavior is:
The text was updated successfully, but these errors were encountered: