in reply to Re: Detecting running from cron?
in thread Detecting running from cron?

Not good, because that environment variable also (ususally) exists from the command line. Try this:
perl -e 'print "foo\n" if exists $ENV{_};'
Best to set a variable in the crontab file, as mentioned below.

Replies are listed 'Best First'.
Re: Re: Re: Detecting running from cron?
by tadman (Prior) on Jan 23, 2001 at 23:33 UTC
    It would seem that the '_' variable is a bash/sh thing, and as I use 'tcsh' for most of my work normally I didn't notice that. Good catch.

    chipmunk has the best approach, with setting an environment variable within your crontab.