Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: Use the time in a script? Message-ID: <1990Sep27.173058.1237@iwarp.intel.com> Date: 27 Sep 90 17:30:58 GMT References: <14183@hydra.gatech.EDU> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 23 In-Reply-To: ce1zzes@prism.gatech.EDU (Eric Sheppard) In article <14183@hydra.gatech.EDU>, ce1zzes@prism (Eric Sheppard) writes: | I would like to make sure that a script or program is not executed during | a certain period of every hour. Is there an elegant method to achieve this, | short of an additional C program? If you can blow off the positional args: set -- `date` case $4 in *:0[0-4]:* ) echo "Bad time to run this" exit 1;; esac If you can't, you'll need to save and restore them, or run this in a subshell (within parens) and check the exit status. Just another sh hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/