aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"