#!/usr/bin/perl use strict; use warnings; my $tmp = `ps -ef`; if ( $tmp !~ /ncp_run.tcl/ ) { my $cmd = 'expect -f /root/nfs_share/SCRIPTS/ncp_run.tcl'; print "starting now: $cmd\n"; exec $cmd; } printf "ncp_run.tcl is already running as of %s: %s\n", scalar(localtime), $tmp );