aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@inria.fr>2025-12-23 13:10:02 +0100
committerTristan Riehs <tristan.riehs@inria.fr>2025-12-23 13:10:02 +0100
commitf697740f39c641220f2b7a37a8b2c3b154568d48 (patch)
tree878ac0bd0b2cf3e90de98f513da8be8dfeab9da2 /shell
parent5d4e2823178c04fb398159c808f2de493dcb2c3b (diff)
Progress on add-dir-rec Shell script
Diffstat (limited to 'shell')
-rwxr-xr-xshell/ftag-add-dir-rec.sh15
1 files 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"