Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Detecting interactive/non-interactive shell

by mifflin (Curate)
on Jul 03, 2005 at 18:17 UTC ( [id://472047]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://472047]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found