File: nqtail.sh

package info (click to toggle)
nq 1.0-0.2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 152 kB
  • sloc: ansic: 539; sh: 169; makefile: 28
file content (17 lines) | stat: -rwxr-xr-x 262 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# nqtail - tail -F the queue outputs, quitting when the job finishes

tailed=false
for f in ${NQDIR:-.}/,*; do
	if ! nq -t $f; then
		tailed=true
		printf '==> %s\n' "$f"
		tail -F $f & p=$!
		nq -w $f
		kill $p
	fi
done

if ! $tailed; then
	cat $f
fi