comparison bin/rq @ 0:2aa53823fb21

new repo
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sat, 06 Jun 2026 10:19:04 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2aa53823fb21
1 #!/bin/bash
2 n=100
3 while [ "x$1" != "x${1##-}" ]
4 do
5 case $1 in
6 -s) shift; args="$args -S date -D"
7 sort=1 # FIXME rq.py unsorts otherwise
8 ;;
9 -S) shift; args="$args -s \"\"" ;;
10 -l) shift; less=1 ;;
11 -n) n=$2 ; shift ; shift ;;
12 -*) args="$args $1" ; shift ;;
13 *) echo usage: rq [-s] [-l] [-n n] [-...] query . . . ; exit 1 ;;
14 esac
15 done
16 args="$args -n $n"
17 /usr/bin/recollq $args -q "$@" > /tmp/rqr$$
18 #recoll $args -t -q "$@" > /tmp/rqr$$
19 head -2 /tmp/rqr$$
20 tail -n +3 /tmp/rqr$$ | if [ "$sort" -o "$less" ]
21 then
22 rq.py "$sort" "$less"
23 else
24 cat
25 fi
26 rm /tmp/rqr$$