summaryrefslogtreecommitdiff
path: root/bin/rtt-foreach
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rtt-foreach')
-rwxr-xr-xbin/rtt-foreach17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/rtt-foreach b/bin/rtt-foreach
new file mode 100755
index 0000000..22feb77
--- /dev/null
+++ b/bin/rtt-foreach
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+if [ -z "$1" ]
+then
+ echo "usage: rtt-foreach <command>"
+ exit 1
+fi
+
+for M in $(sqlite3 db "select title_id from titles")
+do
+ echo "Entering 'public/$M'"
+ if pushd public/$M >/dev/null
+ then
+ "$@"
+ popd >/dev/null
+ fi
+done