#!/bin/csh -f
set ctrl = 1;
while ( $ctrl != 0 )
if ( -e t ) then
source aaa.csh
set ctrl = 0;
else
echo "File Not Found : Sleeping"
sleep 10
endif
end
I feel its solving my purpose, just wanted to confirm with experts.
OK. thanks for posting.. we have a lot of shell experts here to give you ideas (I'm more of a PHP guy these days)..... be patient and someone will reply to you.
I am not csh programmer. I use ksh or bash for everything. But I'll take a stab at this. The only thing I see with the script is the superfluous but harmless semi-colons on those set statements. But I would code it differently to simplify the script...
#! /bin/csh -f
while ( ! -e somefile )
echo file not found -- sleeping
sleep 10
end
source file2
exit 0
and then a test run...
$ ./sleeper
file not found -- sleeping
file not found -- sleeping
file not found -- sleeping
hello
I am file2
$
In another window I typed "touch somefile" to get out of the loop.