Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Controlling Terminal Accuracy

by JaWi (Hermit)
on Oct 02, 2004 at 14:32 UTC ( #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'.


-- 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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2023-12-11 02:00 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.