X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/40979a9da56b90894368a14145d848f4b216a7e5..0e6447ddfc020d3ffbc8a7e3f04db058d4091958:/user/gthumb/rmall.org?ds=sidebyside diff --git a/user/gthumb/rmall.org b/user/gthumb/rmall.org index d5e8986..c973e26 100644 --- a/user/gthumb/rmall.org +++ b/user/gthumb/rmall.org @@ -12,7 +12,7 @@ parent directories (e.g. ~dir1~, ~dir2~) are preserved within ~.trash/~. ** Stats -Version: 0.0.3 +Version: 0.0.4 gThumb version: ~3.12.6~ Suggested keyboard shortcut: ~Shift + T~ @@ -21,7 +21,7 @@ Suggested keyboard shortcut: ~Shift + T~ with each extension type in a separate directory. For example, letʼs say a ~JPG/~ directory contains ~JPG/DSC01001.JPG~, ~JPG/DSC01001.JPG.ots~ and a ~ARW/~ directory contains -~ARW/DSC01001.ARW~. With ~JPG/DSC01001.JPG~ selected in gThumb, +~ARW/DSC01001.ARW~. With ~JPG/DSC01001.JPG~ selected in gThumb, a ~.trash~ directory is created next to ~JPG/~ and ~ARW/~. Then, the following moves are performed: @@ -39,14 +39,14 @@ permanently delete them. ** Code Line-by-line view: #+BEGIN_EXAMPLE -# rmall v0.0.3 +# rmall v0.0.4 dbf=/tmp/gtlog.txt; f="%F"; -fbase="$(basename "$f")"; -fne="${fbase%.*}"; +fBase="$(basename "$f")"; +fne="${fBase%.*}"; dppar="$(dirname %P)"; dtrash="${dppar}/.trash"; -printf "%s\n" "$dbf" "$f" "$fbase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1; +printf "%s\n" "$dbf" "$f" "$fBase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1; for fsrc in "${dppar}/"*"/${fne}".*; do if [ ! -e "$fsrc" ]; then continue; fi; sdname="$(basename "$(dirname "$fsrc")")"; @@ -68,5 +68,5 @@ sleep 1; Paste-ready view: #+begin_example -dbf=/tmp/gtlog.txt; f="%F"; fbase="$(basename "$f")"; fne="${fbase%.*}"; dppar="$(dirname %P)"; dtrash="${dppar}/.trash"; printf "%s\n" "$dbf" "$f" "$fbase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1; for fsrc in "${dppar}/"*"/${fne}".*; do if [ ! -e "$fsrc" ]; then continue; fi; sdname="$(basename "$(dirname "$fsrc")")"; ddest="${dtrash}/${sdname}"; printf "fsrc:%s\n" "$fsrc"; printf "sdname:%s\n" "$sdname"; printf "ddest:%s\n" "$ddest"; if [ ! -d "$ddest" ]; then printf "DEBUG:ddest does not exist:%s" "$ddest"; mkdir -p "$ddest"; else printf "DEBUG:ddest exists:%s" "$ddest"; fi; printf "STATUS: Moving %s → %s\n" "$fsrc" "$ddest/"; mv -n "$fsrc" "$ddest/"; done 1>>"$dbf" 2>&1; sleep 1; +dbf=/tmp/gtlog.txt; f="%F"; fBase="$(basename "$f")"; fne="${fBase%.*}"; dppar="$(dirname %P)"; dtrash="${dppar}/.trash"; printf "%s\n" "$dbf" "$f" "$fBase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1; for fsrc in "${dppar}/"*"/${fne}".*; do if [ ! -e "$fsrc" ]; then continue; fi; sdname="$(basename "$(dirname "$fsrc")")"; ddest="${dtrash}/${sdname}"; printf "fsrc:%s\n" "$fsrc"; printf "sdname:%s\n" "$sdname"; printf "ddest:%s\n" "$ddest"; if [ ! -d "$ddest" ]; then printf "DEBUG:ddest does not exist:%s" "$ddest"; mkdir -p "$ddest"; else printf "DEBUG:ddest exists:%s" "$ddest"; fi; printf "STATUS: Moving %s → %s\n" "$fsrc" "$ddest/"; mv -n "$fsrc" "$ddest/"; done 1>>"$dbf" 2>&1; sleep 1; #+end_example