lets say we were to use standard bash terminology to write a for loop which loops srm to securely erase a item on your drive.
Now lets say we set it to iterate 10 times, after it is done the first iteration, How can it still work on the file? The file should no longer exist, so how can It erase it? Not a question specific to srm, anything can be ran. Even something like mv, even when the file is no longer availible.
It’ll run through the loop 10 times, but except on the first iteration, the command you’re executing will fail (and return -1). The command will also write out any error messages it normally writes out (to stdout, stderr or a file).
Now, assuming there’s a file called
something, you get:Note that this happens 4 times, not 5, since the first time,
rmran successfully.