From 320f877c1b3dd875dac0ae086dcc0ccce88fe307 Mon Sep 17 00:00:00 2001 From: xyz Date: Tue, 24 Aug 2021 23:27:16 -0700 Subject: consider -- situation for orgext --- .local/bin/orgext | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.local/bin/orgext') diff --git a/.local/bin/orgext b/.local/bin/orgext index ed53c271..e652df61 100755 --- a/.local/bin/orgext +++ b/.local/bin/orgext @@ -7,16 +7,16 @@ outdir () { - find . -type f -execdir mv -t "$PWD" '{}' \+ - find . -mindepth 1 -maxdepth 1 -type d -execdir rm -r '{}' \+ + find . -type f -execdir mv -t "$PWD" -- '{}' \+ + find . -mindepth 1 -maxdepth 1 -type d -execdir rm -r -- '{}' \+ } # 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 # maybe better if make all uppercase to lowercase, is it possible to use awk for that? indir () { - find . -maxdepth 1 -type f | awk -F. '!a[$NF]++{print $NF}' | xargs mkdir - find . -mindepth 1 -maxdepth 1 -type d -execdir basename -az '{}' \+ | xargs -0 -I _ find . -maxdepth 1 -type f -name '*._' -execdir mv -t '_' '{}' \+ + find . -maxdepth 1 -type f | awk -F. '!a[$NF]++{print $NF}' | xargs mkdir -- + 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