Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: interactive vs cron called



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