summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-24 01:33:30 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-24 01:33:30 +0100
commit451b5e613bc3194869a8974ed63f4e85b3e132a4 (patch)
tree67b399a2c97465c6ced993295cee2170bd1e4cb5
parent76503f761db72b91882ce497940534e28ffe421f (diff)
downloadmsc-451b5e613bc3194869a8974ed63f4e85b3e132a4.tar.gz
Add 'flt' (filter out) tool
-rwxr-xr-xflt11
1 files changed, 11 insertions, 0 deletions
diff --git a/flt b/flt
new file mode 100755
index 0000000..88797be
--- /dev/null
+++ b/flt
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Filter out existing tracks
+
+tmp=/tmp/flt.$RANDOM
+find "$@" -type f -name '*.mp3' |
+xargs -I {} basename -s.mp3 "{}" |
+sed 's/\(.*\) - \(.*\)/\2\t\1/' > $tmp
+
+fgrep -vf $tmp
+rm $tmp