Sponsored Content
Top Forums Shell Programming and Scripting How to check if export DISPLAY is set or not? Post 302373411 by Scott on Friday 20th of November 2009 07:26:45 AM
Old 11-20-2009
Hi.

No, you can use it as-is. Place it near the top of your script.

If DISPLAY is not exported, your script won't see it and this will print a message and exit.

It's the same as
Code:

if [ -z "$DISPLAY" ]; then
  echo Display not set
  exit 1
fi

If you need to check for a specific value in DISPLAY, you can try this:

Code:
[ "$DISPLAY" != "same_host:0.0"  ] && echo Display not set && exit 1

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

export DISPLAY and XPM´s

Hi! I´ve an application that runs in a Digital Tru64, exporting display to a Linux host. That application blinks a icon (in XPM mode) when the severity mode changes. When I put a backdrop(XPM, too) in that screen, the icons blink slowly. When I remove it, they turn to blink quickly. I have... (3 Replies)
Discussion started by: selina
3 Replies

2. Shell Programming and Scripting

do a export DISPLAY

hello to begin i sorry for my english because i'am french so: someone can explain me to do a export DIPLAY with a web page (php) i have test the php function exec (myscriptshell.sh) but he can't do the export diplay. if someone have a solution . bye (1 Reply)
Discussion started by: the_nul
1 Replies

3. UNIX for Dummies Questions & Answers

difference between set and export

Hi, can anybody tell me what is the difference between set and export in unix. -Ashish (1 Reply)
Discussion started by: shriashishpatil
1 Replies

4. UNIX for Dummies Questions & Answers

How to export the Display variable

I'm trying to open an xwindow on my Sun server. What am I doing wrong? # echo $SHELL /sbin/sh # # export DISPLAY=localhost:0.0 DISPLAY=localhost:0.0: is not an identifier Thank you! (1 Reply)
Discussion started by: FredSmith
1 Replies

5. Solaris

Cant export display from aix to solaris.

Hi Frnds, i face a peculiar issue. I am managing 200 Aix workstations and 20 sun boxes. I am not anle to export the display from aix workstations to sun box, But vice versa it is working fine. But if i try to export the display to a sun box from other sun box it works perfectly. Could... (3 Replies)
Discussion started by: sriram.s
3 Replies

6. Shell Programming and Scripting

use of set, export and typeset

what is the difference in usage of set, export, typeset while declaring a value to a variable can any one help thanks (0 Replies)
Discussion started by: trichyselva
0 Replies

7. UNIX for Advanced & Expert Users

export display

hello frnds, I want to export display of othe terminal to my terminal and want to post a msg, which should visible at other terminal, I tried myself, but couldnt get it plz help me to get solution (1 Reply)
Discussion started by: sushant.pathade
1 Replies

8. Solaris

export DISPLAY

rsh to host2 from host1 and from host2 rsh into host3 Is it possible to display a GUI from host3 through host2 and onto host1? (1 Reply)
Discussion started by: eddiet
1 Replies

9. UNIX for Advanced & Expert Users

DISPLAY=local_host:0.0 ; export DISPLAY

Hi, from my Windows Workstation I can connect with PUTTY to an AIX 6.1 unix server. On AIX via PUTTY I run DBCA which has a grphical interface. Then : #DISPLAY=local_host:0.0 ; export DISPLAY $(hostname) $(whoami):/appli/oracle/product/10.2.0/db_1/bin#dbca _X11TransSocketINETConnect()... (12 Replies)
Discussion started by: big123456
12 Replies

10. Solaris

export vs env vs set commands

Hi I'm trying to understand variable scopes in solaris10. It is said that to display env variables we use 3 commands : - env - set - export What is the difference between them ? thx for help. ---------- Post updated at 11:00 AM ---------- Previous update was at 10:50 AM ---------- ... (2 Replies)
Discussion started by: presul
2 Replies
PODEBCONF-DISPLAY-PO(1) 					    po-debconf						   PODEBCONF-DISPLAY-PO(1)

NAME
podebconf-display-po - display content of a PO file in a debconf interface SYNOPSIS
podebconf-display-po [-h] [-f FRONTEND] file.po DESCRIPTION
As with any other localization work, translators should test their translations by running the program they are working on. But this is a very hard job with complicated configuration scripts because there is no automatic way to have all messages displayed. The podebconf-display-po program could be called the Poor Man Localization Checker for debconf. It parses a PO file, tries to guess what the original templates file did look like, and displays messages in a debconf interface. Of course being root is not mandatory, and there is no interaction between podebconf-display-po and system-wide debconf settings. OPTIONS
-h, --help Display a usage summary and exit. -f, --frontend=FRONTEND Select an alternate debconf frontend. CAVEATS
o As podebconf-display-po relies on "debconf" to display questions, your environment must be setup to display localized questions in the language of the PO file. If you want to check a translation in another language, you need to temporarily change your settings, e.g. $ LANGUAGE=de podebconf-display-po de.po If the PO file cannot be converted into your current encoding, English strings are displayed instead of the localized ones. You then have to switch to a UTF-8 environment to prevent encoding mismatch. o Prior to 0.8.3, "po-debconf" did only insert the field name in PO files. But some discussions on mailing-lists showed that text format does depend on template type, e.g. string and boolean types are different because the former is an open question and user has to enter some text input, whereas the latter is basically a Yes/No question. Authors have to think about it when writing their templates files, but translators also have to be aware. This is achieved when PO files are generated by po-debconf >= 0.8.3, template type is inserted in PO files. With older versions, podebconf-display-po has a trivial algorithm to determine original template type, and may sometimes be wrong. o The "dialog" frontend, when based upon "whiptail", traps system signals and thus podebconf-display-po cannot be interrupted by "Ctrl-C" when using this frontend. SEE ALSO
debconf(1) AUTHOR
Denis Barbier <barbier@linuxfr.org> 2010-11-17 PODEBCONF-DISPLAY-PO(1)
All times are GMT -4. The time now is 10:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy