I have a shell script running in a windows environment in a cygwin environment. This script has one cleanup function that deletes a specific folder on a system basis under certain conditions.
I will prepare a list of the entire folder that I want to delete, and then use the following command:
rm -rfv $purge (where purge is the list of directories I want to delete)
Now that I have tested this script, directories are not deleted at all. At first I thought there was a problem with the cleanup list, but when debugging, I found out that the cleanup list is ok.
After a lot of debugging and testing, I just made a small change to the command:
\rm -rfv $purge
This is just a hit and trial, and the script starts working fine. Now, as far as I know, \ rm and rm -f both mean force removal.
Now, how can I justify this why rm -f works, but rm -f works earlier. I want to know the main difference between the two teams.
source
share