aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshell/ftag-add-dir-rec.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/shell/ftag-add-dir-rec.sh b/shell/ftag-add-dir-rec.sh
new file mode 100755
index 0000000..f8c489d
--- /dev/null
+++ b/shell/ftag-add-dir-rec.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ $# -eq 0 ]
+then
+ echo "Usage: $0 DIR..."
+fi
+
+tmp_file="$(mktemp)"
+for dir in "$@"
+do
+ find "$dir" -type f -fprint "$tmp_file"
+done
+
+cat "$tmp_file" | uniq -u | xargs -d '\\n' ftag file add