summaryrefslogtreecommitdiff
path: root/src/categories
blob: a0540692e99762893ce3abef2c8f0026bb449e74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -euo pipefail


usage() {
	echo 'Usage: categories DIRECTORY'
}

DIRECTORY="${1:-}"
eval "$(assert-arg -- "$DIRECTORY" 'DIRECTORY')"

listall() {
	find "$DIRECTORY"/category.*.*.sortdata | cut -d. -f2 | sort | uniq
}

for category in `listall`; do
	out="$DIRECTORY"/categories."$category".sortdata
	cat "$DIRECTORY"/category."$category".*.sortdata > "$out"
	printf '%s\n' "$out"
done