Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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'.

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? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2022-08-10 13:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?