Mercurial > hg > cc > cirrus_work
annotate bin/wprog.sh @ 396:10813bab9072 plus tip
added test 9 for wat that pretty-prints json content
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Tue, 30 Jun 2026 16:50:56 +0100 |
| parents | 2502b81838da |
| children |
| rev | line source |
|---|---|
|
318
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
1 #!/usr/bin/bash |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
2 # Usage wprog.sh seg start end=$(date) ty='warc' |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
3 seg="$1" |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
4 shift |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
5 start="$1" |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
6 shift |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
7 end=$(date) |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
8 ty='warc' |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
9 while [ "$1" ] |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
10 do |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
11 case "$1" in |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
12 [A-Z]*) |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
13 end="$1" |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
14 shift |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
15 ;; |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
16 warc|robotstxt|crawldiagnostics) |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
17 ty=$1 |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
18 shift |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
19 ;; |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
20 *) |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
21 echo "Hunh?" "$@" 1>&2 |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
22 echo "Usage: wprog.sh start end=$(date) ty='warc'" 1>&2 |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
23 exit 1 |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
24 ;; |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
25 esac |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
26 done |
|
2502b81838da
for tracking progress (of w2c?)
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
27 wprog.py $(fgrep -ch records x?/$seg/$ty/w* | btot -s | cut -f 2) "$start" "$end" |
