[Gloucs] shell script

Guy Edwards gloucs at mailman.lug.org.uk
Fri Dec 20 01:39:01 2002


On Thu, 2002-12-19 at 23:56, Mick Brooks wrote:
> Doesn't $$ contain the PID of the script? You probably want to stick your
> process in the background (as Will says) and use $!.

yep, working 100% now, the cat can live

----------
#!/bin/bash

echo "Starting Run"

opens=0

while [ $opens -lt 5 ] ; do
        viewer &
        sleep 5
        kill $!
        opens=$(($opens+1))
        echo "Program has been run $opens times"
done
----------

Cheers for the help guys
Guy