in reply to Re: Detecting cron
in thread Detecting cron

That depends: if the .profile sets the environment variable you're testing for, then after it's been run, the variable exists. So you need to test first :-)

OTOH, the .profile isn't going to have any effect on the arrangement of STDIN and STDOUT, so they'll still be safe to test (or safe to rely on the fact that STDIN just returns EOF...)

--
Tommy
Too stupid to live.
Too stubborn to die.