#!/usr/bin/perl use strict; while (1) { my $running=`ps ax|grep "soffice.bin -quickstart"`; if ($running !~ /openoffice/) { # don't match if only the "grep" is there sleep 5; # give the process time to end to avoid silly crashes... system("/usr/lib/openoffice/program/soffice.bin -quickstart -plugin"); } }