From e58e83eb0b39f773e49f44c9d38bf48bc6e00aae Mon Sep 17 00:00:00 2001 From: xyz Date: Fri, 27 Aug 2021 19:29:17 -0700 Subject: use -delete instead of -execdir rm --- .local/bin/orgext | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/orgext b/.local/bin/orgext index 53203d4d..2ece9e72 100755 --- a/.local/bin/orgext +++ b/.local/bin/orgext @@ -8,8 +8,8 @@ outdir () { - find . -type f -execdir mv -t "$PWD" -- '{}' \+ - find . -mindepth 1 -maxdepth 1 -type d -execdir rm -r -- '{}' \+ + find . -type f -execdir mv -nt "$PWD" -- '{}' \+ + find . -mindepth 1 -maxdepth 1 -type d -delete } # may further optimize by output file extension names to a variable and use it for both mkdir and mv, current is fast enough for me -- cgit v1.2.3-70-g09d2