Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: interactive vs cron called
- X-seq: zsh-users 1210
- From: Danek Duvall <duvall@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: interactive vs cron called
- Date: Thu, 18 Dec 1997 20:44:45 -0500
- In-reply-to: <hvgpvmujpcr.fsf@xxxxxxxxxxxxxxxxxxxx>; from Jason Zapman II on Thu, Dec 18, 1997 at 04:47:16PM -0500
- References: <hvgu3c6jsw4.fsf@xxxxxxxxxxxxxxxxxxxx> <hvgpvmujpcr.fsf@xxxxxxxxxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author