#!/bin/sh poll_sec=15 imax=`expr 10000 / ${poll_sec}` if [ $# -ge 1 ]; then imax=$1 fi echo "LISTEN first;" echo "LISTEN second;" i=0 while [ $i -lt $imax ]; do echo "SELECT pg_sleep(${poll_sec});" i=`expr $i + 1` done