summary refs log tree commit diff
path: root/fq
diff options
context:
space:
mode:
Diffstat (limited to 'fq')
-rwxr-xr-xfq8
1 files changed, 7 insertions, 1 deletions
diff --git a/fq b/fq
index 8cf3832..99774fe 100755
--- a/fq
+++ b/fq
@@ -1,11 +1,17 @@
 #!/bin/sh
-# fq - tail -f the queue outputs, quitting when the job finishes
+# fq - 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