How to set DISPLAY env. in script.

How do you set DISPLAY env. using scripting?

# cat /tmp/TMP_DISP
localhost:15.0

------

#!/bin/ksh
#
if [ -f /tmp/TMP_DISP ]
then
    export DISPLAY=`cat /tmp/TMP_DISP`
fi

------

After running the script...

# echo $DISPLAY

#

Thanks,
Mitch J.





0
Mitch
1/30/2007 1:54:30 AM
comp.sys.sun.admin 3737 articles. 0 followers. bozothedeathmachine16 (49) is leader. Post Follow

2 Replies
910 Views

Similar Articles

[PageSpeed] 40

In comp.unix.solaris Mitch J. <tsmclcenbt@comcast.net> wrote:
> How do you set DISPLAY env. using scripting?

Set it in your .profile, or "source" the script... don't execute it.

When you run a script like an executable program, a new shell gets started
and executes it.  You're only changing the environment of THAT shell.
Once it's done and exits, your original shell is left in exactly the same
shape as when you began.

-- 
Brandon Hume    - hume -> BOFH.Ca, http://WWW.BOFH.Ca/
0
hume
1/30/2007 2:27:35 AM
"Mitch J." <tsmclcenbt@comcast.net> writes:
>
>    export DISPLAY=`cat /tmp/TMP_DISP`
>

As a side note, this is more efficient for reading the contents
of a file into a variable in ksh:

   export DISPLAY=$(< /tmp/TMP_DISP )

It saves the shell forking and exec'ing /usr/bin/cat.

This syntax is documented in the ksh man page, though it isn't
easy to find.  I've tested it on Solaris 7 and later, but I think
it's supported in earlier versions of Solaris too.

  -Greg
-- 
Do NOT reply via e-mail.
Reply in the newsgroup.
0
gerg
1/30/2007 5:46:58 PM
Reply:

Similar Artilces:

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45340632409)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45340632409) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341557610)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341557610) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339432412)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339432412) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341214407)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341214407) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45338231818)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45338231818) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339114417)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339114417) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339757607)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339757607) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341557610)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341557610) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339714409)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45339714409) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341257603)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341257603) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341532407)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45341532407) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45338814415)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45338814415) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45340014407)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45340014407) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent com...

US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45338514409)
US-TX-Austin: UNIX System Admin, 2+yrs Sun Solaris admin, shell scripting; Perm (45338514409) ============================================================================================= Position: UNIX System Admin Reference: SMC01924 Location: Austin TX Duration: Perm Skills: B.S. in Electrical Engineering or Computer Science (or equivalent experience). Minimum of 2 years experience in Sun Solaris Administration. Demonstrated proficiency with networking and shell scripting. Excellent communication &a...

Web resources about - How to set DISPLAY env. in script. - comp.sys.sun.admin

Comparison of display technology - Wikipedia, the free encyclopedia
CRTs use an electron beam, scanning the display, flashing a lit image. If interlacing is used, a single full-resolution image results in two ...

Trademark suggests Samsung Galaxy S7 lineup may get ‘Always On Display’ features
In its relentless push for adding new features, Samsung may have just accidentally revealed a potentially interesting property of its new devices, ...

Poll: Should future iPhones offer always-on or Watch-style motion-activated displays?
No, it’s not as dumb a question as it seems. While keeping the full iPhone display on full-time would quickly drain the battery, there are ways ...

HTC One M10 reportedly will feature a 5.2-inch display
... size, until now. Samsung Galaxy S7 rumor roundup LG G5 rumor roundup Initial rumors suggested we were looking at a larger 5.1-inch QHD display ...

Google display ads going all-HTML, will ban Flash in 2017
On the Adwords Google+ page , Google just announced a timeline for banishing Flash from its advertising network, announcing that "Google Display ...

Confirmed: LG G5 will have an always on display
LG really can’t wait to launch the LG G5 already. The company confirmed a few days ago in a tweet that the handset will be unveiled on February ...

Google just set in stone a timeline to ban Adobe Flash from its display adverts
Google just laid out a timeline to get rid of Adobe Flash from its display advertising services. From January 2, 2017 ads in the Flash format ...

The whiteboards of tomorrow: 3 interactive displays
Meetings are made more productive by digital 'whiteboards' that you can write on and interact with. We review three new displays by InFocus, ...

LG G5 to have always-on display
LG is teasing the G5, its new flagship smartphone. It looks like it’ll have an always-on display, but unlike previous efforts, it won’t destroy ...

LG G5 Will Have an Always-On Display
... to make the G5 standout? Outside of the phone’s dual cameras and premium build, it looks they are also planning to give it an always-on display. ...

Resources last updated: 2/11/2016 2:56:01 PM