From f697740f39c641220f2b7a37a8b2c3b154568d48 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Tue, 23 Dec 2025 13:10:02 +0100 Subject: Progress on add-dir-rec Shell script --- shell/ftag-add-dir-rec.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/shell/ftag-add-dir-rec.sh b/shell/ftag-add-dir-rec.sh index f8c489d..c5a1f6b 100755 --- a/shell/ftag-add-dir-rec.sh +++ b/shell/ftag-add-dir-rec.sh @@ -5,10 +5,19 @@ then echo "Usage: $0 DIR..." fi -tmp_file="$(mktemp)" +tmp_file_0="$(mktemp)" +> "$tmp_file_0" for dir in "$@" do - find "$dir" -type f -fprint "$tmp_file" + find "$dir" -type f -exec sh -c "printf '%s\t%s\n' \"$(basename {})\" \"{}\" >> \"$tmp_file_0\"" ';' done -cat "$tmp_file" | uniq -u | xargs -d '\\n' ftag file add +# cut -f1 < "$tmp_file_0" + +for file in $(cut -f1 < "$tmp_file_0" | uniq -u) +do + echo "$file" +done + +# uniq -u < "$tmp_file_0" | xargs -d '\\n' ftag file add +rm "$tmp_file_0" -- cgit v1.2.3