#!/bin/csh -f

echo "Waiting for printer to free up"

while (1)
  sleep 1
  set n=`lpq | grep "bytes" | wc`
  if ($n[1] == 0) exit 0
  sleep 5
end
