Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: system call in crontab

by Bloodnok (Vicar)
on Jul 20, 2009 at 13:34 UTC ( [id://781621]=note: print w/replies, xml ) Need Help??

in reply to Re: system call in crontab
in thread system call in crontab

In all cases, a script, assuming sh/ksh (& csh for all I know), can determine whether the shell is interactive by testing $- - if it contains the i switch, then it's an interactive shell - which is why the following is commonly seen at the end of a users .profile...
. . case "$-" in *i*) # Interactive shell exec bash ;; *) # Do nothing of the sort - non-interactive : ;; esac
Otherwise, any attempt to dot the .profile from a non-interactive shell causes the attempt to hang since the newly exec(1)ed shell will be waiting for input.

Having said that, any job started by cron will always be run non-interactively - such that if any output i.e. either STDOUT or STDERR, is not redirected, it will be mailed to the crontab(1M)s user.

I'm rather intrigued as to why the OP is attempting to start a GUI program using cron(1M) - if the intent is to create a background image, then .xinitrc or similar is place to start it or alternatively use the background property of the window manager.

A user level that continues to overstate my experience :-))

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-15 06:44 GMT
Find Nodes?
    Voting Booth?

    No recent polls found