Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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 :-))

In reply to Re^2: system call in crontab by Bloodnok
in thread system call in crontab by naildownx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-08-14 00:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?