From 4cfa508c3077006e800a841074363882cb7f3965 Mon Sep 17 00:00:00 2001 From: xyz Date: Sun, 3 Oct 2021 01:41:51 -0700 Subject: change mind, use -execdir instead of -exec for find --- .local/bin/orgext | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.local/bin/orgext') diff --git a/.local/bin/orgext b/.local/bin/orgext index 58cc8b86..db813db2 100755 --- a/.local/bin/orgext +++ b/.local/bin/orgext @@ -7,14 +7,14 @@ outdir () { - find . -type f -exec mv -nt "$PWD" -- '{}' \+ + find . -type f -execdir mv -nt "$PWD" -- '{}' \+ find . -mindepth 1 -maxdepth 1 -type d -delete } indir () { find . -maxdepth 1 -type f | awk -F. '!a[$NF]++{print $NF}' | xargs mkdir -- - find . -mindepth 1 -maxdepth 1 -type d -exec basename -az -- '{}' \+ | xargs -0 -I _ find . -maxdepth 1 -type f -name '*._' -exec mv -t '_' -- '{}' \+ + find . -mindepth 1 -maxdepth 1 -type d -execdir basename -az -- '{}' \+ | xargs -0 -I _ find . -maxdepth 1 -type f -name '*._' -execdir mv -t '_' -- '{}' \+ } case "$1" in -- cgit v1.2.3-70-g09d2