in reply to Detecting interactive/non-interactive shell

I think you can use the "-t FILEHANDLE".

From perlfunc:
-t Filehandle is opened to a tty.
If you test STDIN (or maybe STDOUT) with -t and it returns false you should be running from a cron. I think. If you have the perl cookbook i think there is a recipe on this. I don't have it with me. Maybe someone else does.

Formatting fixed by holli

  • Comment on Re: Detecting interactive/non-interactive shell