Is there a Null value for DISPLAY variable?

Is there a Null value for DISPLAY variable?

Post by Peter Samuels » Wed, 07 Oct 1998 04:00:00




Quote:> > Well, the application runs from CRON and I doesn't generate any
> > display.  Still it requires a DISPLAY=blablabla.  Is there some
> > blablabla that would work as a null device that is would accept the
> > data to be displayed and trash it?


Quote:> If the machine is running a X server, DISPLAY=:0 should work.

Nope.  Not unless you're willing to check for someone being logged in
on the console, then poke around for the relevant home directory and
.Xauthority file....  (And this assumes that your cron job has
appropriate privileges to read everyone's .Xauthority files.)

What does this application, which you intend to run from cron, need
DISPLAY for anyway?  If it can usefully be run in batch yet still wants
to have an X server around for comfort, it is badly written.  Fix the
app (or just hack the X support out) and recompile.  If you don't have
the source code, ask for your money back.  (:

--
Peter Samuelson
<sampo.creighton.edu!psamuels>

 
 
 

Is there a Null value for DISPLAY variable?

Post by Dan A. Merc » Wed, 07 Oct 1998 04:00:00



: > > Well, the application runs from CRON and I doesn't generate any
: > > display.  Still it requires a DISPLAY=blablabla.  Is there some
: > > blablabla that would work as a null device that is would accept the
: > > data to be displayed and trash it?

: > If the machine is running a X server, DISPLAY=:0 should work.

: Nope.  Not unless you're willing to check for someone being logged in
: on the console, then poke around for the relevant home directory and
: .Xauthority file....  (And this assumes that your cron job has
: appropriate privileges to read everyone's .Xauthority files.)

: What does this application, which you intend to run from cron, need
: DISPLAY for anyway?  If it can usefully be run in batch yet still wants
: to have an X server around for comfort, it is badly written.  Fix the
: app (or just hack the X support out) and recompile.  If you don't have
: the source code, ask for your money back.  (:

Well,  myabe he's doing what we're doing,  which is extracting
documents from a document management system,  printing them to
postscript,  converting the postscript to portable document format and
putting the result on our web site.  That requires us to run our
word processor and we run it against a virtual display,  the
X11R6.3 program Xvfb (X virtual frame buffer).  Works great,  lasts
a long time.  You need to get the X11R6.3 distribution and read the
instructions very carefully.   It's a *.

: --
: Peter Samuelson
: <sampo.creighton.edu!psamuels>

--
Dan Mercer

Opinions expressed herein are my own and may not represent those of my employer.

 
 
 

1. detecting difference between unset variable and variable whose value is null in Korn Shell

I'm writing a Korn Shell.

 I want to assign default values to environment variables only if they
 are
 not already set.  A null string value is valid.

 ex.

 Before invoking script.

 export str1="hello"
 export str2=
 unset str3

 Now inside my script I want the following logic, (pseudo code)

 if ( $str1 doesn't exist )
   export str1="str1 set to default"
 fi
 if ( $str2 doesn't exist )
   export str3="str2 set to default"
 fi
 if ( $str3 doesn't exist )
   export str3="str3 set to default"
 fi

 print "str1= $str1"
 print "str2= $str2"
 print "str3= $str3"

 I should see the following on the screen:

 str1= hello
str2=
str3= str3 set to default

 My problem is that I don't know how to detect the difference between an
 unset variable and a variable whose value is null.
 ( i.e. str2 and str3 ).

 Does anybody know how?

 Thanks in advance.

 Jeff

2. login program problem

3. Setting variables in a variable array of null variables

4. what do you do when malloc fails?

5. Checking variable value for blank or null

6. Reply-To gets modified in Mush/Linux

7. Assigning a Value to Null Variables (sh)

8. Cant use local QT library, because of "undefined reference" in qvaluelist.h

9. testing for null value in variable

10. "/dev/null" for DISPLAY variable

11. Display value of environment variable

12. value of the variable DISPLAY AIX

13. How do you display the value of a variable...