From c540423ba3e3c63b9751756a19b5fd3debd1f260 Mon Sep 17 00:00:00 2001 From: neingeist Date: Tue, 18 Oct 2022 16:45:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20rmdir-empty:=20ignore=20cwd=20to?= =?UTF-8?q?=20avoid=20error=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rmdir-empty | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rmdir-empty b/rmdir-empty index a2db42d..9a9ad64 100755 --- a/rmdir-empty +++ b/rmdir-empty @@ -1,3 +1,5 @@ #!/bin/sh # recursively delete empty directories -find . -depth -type d -empty -exec rmdir -v {} \; +find . -depth \ + -path "." -prune -or \ + -type d -empty -exec rmdir -v {} \;