summaryrefslogtreecommitdiff
path: root/bin/rtt-foreach
blob: 22feb775cd22cc976de085618177849418274099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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