Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Controlling Terminal Accuracy

by JaWi (Hermit)
on Oct 02, 2004 at 14:32 UTC ( [id://395889]=note: print w/replies, xml ) Need Help??


in reply to Controlling Terminal Accuracy

You can use the -t operator to check whether your script is connected to a TTY. At least under my Debian system, I get a positive result (1) for the -t operator for a job started from the console, and nothing for 'crontabbed jobs'.

HtH,

-- JaWi

"A chicken is an egg's way of producing more eggs."

Replies are listed 'Best First'.
Re^2: Controlling Terminal Accuracy
by steves (Curate) on Oct 02, 2004 at 15:18 UTC

    That's slightly different than the controlling terminal. The controlling terminal (in UNIX) is the terminal the job is associated with for signals, but not necessarily the terminal the job is connected to. For example, running a command pipeline or redirected command from the shell will make the process not have a terminal connected to it, but it will still have a controlling terminal. A cron job will have neither a connected terminal or a controlling terminal. The difference is subtle but can be important for things like daemons.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found