From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16773 invoked from network); 18 Dec 1997 21:35:30 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 18 Dec 1997 21:35:30 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id QAA10720; Thu, 18 Dec 1997 16:04:33 -0500 (EST) Resent-Date: Thu, 18 Dec 1997 16:04:13 -0500 (EST) Message-ID: <19971218160503.63049@astaroth.nit.gwu.edu> Date: Thu, 18 Dec 1997 16:05:03 -0500 From: Sweth Chandramouli To: zsh-users@math.gatech.edu Subject: Re: interactive vs cron called Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e Resent-Message-ID: <"0NRto2.0.uc2.C_Ocq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1207 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Thu, Dec 18, 1997 at 03:30:51PM -0500, Jason Zapman II wrote: > Is there a way to tell if a script is being called by cron or via > interactive script? I'm writing something to tell me when disk usage of > various partitions get's to dangerous levels. When it's run via cron, I > want it to mail me the results. If it's interactive, I want it to print > the output to the screen. why not just have it print output to screen, and in the crontab run the command through a pipe to a command-line mailer? alternately, write your script to accept a command line option to send you mail, and invoke the cron using that option. -- sweth. -- "Countin' on a remedy I've counted on before Goin' with a cure that's never failed me What you call the disease I call the remedy" -- The Mighty Mighty Bosstones