4 May
2012
4 May
'12
1:44 a.m.
On 04/05/12 09:40, Jeremy Huntwork wrote:
On 5/3/12 7:34 PM, Allan McRae wrote:
On 04/05/12 09:12, Jeremy Huntwork wrote:
find . -mindepth 1 -depth -type d -exec rmdir "{}" + 2>/dev/null || true
Anything else is a lot more code and more cumbersome. If the || true in this instance is unacceptable, then I will probably just submit the changes for the compression section and maintain this modification as a private patch or sed command for myself.
Why do you need "|| true"?
Because of #!/bin/bash -e
find may also discover non-empty directories for which rmdir will fail (we actually want it to fail, obviously). But that exit status would also stop execution of the code.
Please work from the master branch where "-e" does not exist anymore... Allan