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.

JH

Reply via email to