From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18603 invoked from network); 19 Dec 1997 02:12:30 -0000 Received: from ns2.primenet.com.au (7795@203.24.36.3) by ns1.primenet.com.au with SMTP; 19 Dec 1997 02:12:30 -0000 Received: (qmail 1205 invoked from network); 19 Dec 1997 02:12:13 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns2.primenet.com.au with SMTP; 19 Dec 1997 02:12:13 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id UAA13858; Thu, 18 Dec 1997 20:44:08 -0500 (EST) Resent-Date: Thu, 18 Dec 1997 20:43:46 -0500 (EST) Message-ID: <19971218204445.01874@lorien.princeton.edu> Date: Thu, 18 Dec 1997 20:44:45 -0500 From: Danek Duvall To: zsh-users@math.gatech.edu Subject: Re: interactive vs cron called References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88 In-Reply-To: ; from Jason Zapman II on Thu, Dec 18, 1997 at 04:47:16PM -0500 Resent-Message-ID: <"eF8mP3.0.uN3.H5Tcq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1210 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Checking the return value of tty -s does the trick for me in a similar situation (distinguishing between command-line invocation and getting called as a pipe), as it tells you what's attached to stdin. I'm pretty sure that cron runs its jobs with stdin not connected to anything, so that trick ought to work for you, too. Perl has a builtin function for this, as the -t flag to the [ function. It might be useful to have this functionality in zsh, too, but as it's obviously possible with a functioning unix setup, it's not necessary. Danek