[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

automating execution of script; was Re (3): automating x permission on a file.



*	From: Bob Proulx <bob@proulx.com>
*	Date: Wed, 14 Dec 2011 13:43:07 -0700
> A process listens through inotify on the receiving end 
> for the control file.  ... When control files appear 
> the incoming handling process reads the file and
> acts upon the instructions included in the file.

Thanks.  I've got the general idea.

Package inotify-utils is installed.  Suppose ~/.bashrc ends with these 5 lines.

exec while 1 do
if (inotifywait -e modify ~/control.sh) = 0 
  then { chmod u+x ~/control.sh; ~/control.sh; } > controlresult 
fi
done

Whenever a fresh version of control.sh is put into ~ it is executed with 
results kept in controlresult.  

Any further tips before I shoot myself in the foot?
 
   Thanks,                      ... Peter E.
     

-- 
Telephone 1 360 639 0202.  Former telephone 1 360 450 2132.  
bcc: peasthope ... shaw.ca
"http://carnot.yi.org/";
"http://members.shaw.ca/peasthope/index.html#Itinerary";


Reply to: