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 3736 articles. 0 followers. bozothedeathmachine16 (49) is leader. Post Follow

2 Replies
869 Views

Similar Articles

[PageSpeed] 11
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:

uitable: add new rows and set name for last row
Hi! I want to add new rows at the end of an uitable and set the name for this new row. So far,I am able to add new rows to my uitable with following code: data = get(handles.uitable3,'data'); newRowdata = cat(1,data,cell(1,size(data,2))); set(handles.uitable3,'data',newRowdata); guidata(hObject,handles); But how can I change the name only of the LAST row? Thanks for help, Mario On 08/09/2014 3:15 PM, Mario wrote: > Hi! > > I want to add new rows at the end of an uitable and set the name for > this new row. So far,I am able to add new rows to my...

Setting up X on FreeBSD?
This is just kind of a general question. I've done this before in past flirts with FreeBSD, but I couldn't get it right last night for some reason. I'm wondering how easy others find this to be, getting X with a GDM or something like that going. I couldn't get GDM going at all and KDM got hung after logging in. So I'm a little worried. I'm trying to switch from SuSE to FreeBSD. I've used FreeBSD in the past with little trouble, but this time around (4.9) for some reason I'm having trouble with getting X setup right. ...

Set processor core affinity to a thread
Hello, Is there anyway I can set up a thread to run on a specific processor core? say on Windows XP. (any other windows OS?). Is there a direct API which can do this? If not is there some other indirect way to achieve this? Thanks persres <persres@googlemail.com> writes: > Is there anyway I can set up a thread to run on a specific > processor core? say on Windows XP. (any other windows OS?). > Is there a direct API which can do this? If not is there some other > indirect way to achieve this? You can use SetThreadAffinityMask to limit which CPUs or cores ...

US-NY-Rochester: Tester, Silk, Perl, Oracle, Unix scripting, SQL, Toad, Training (45338057601)
US-NY-Rochester: Tester, Silk, Perl, Oracle, Unix scripting, SQL, Toad, Training (45338057601) ============================================================================================== Position: Tester Reference: SMC01871 Location: Rochester NY Duration: 6M Skills: Testing using Silk, Perl,oracle, Unix scripting, SQL, Toad Web based testing exp Advanced skills with web-appls capture/playback automation using Silk Understand development strategies Excellent Tech Writing skills ...

Setting column order in JTable
I've been battling with this all afternoon, time for help! I have my intended set of indexes eg 0, 4, 2, 1, 3 How do I apply them to my newly created table which has my own table model applied to it? Here are some pokings about I've tried: DefaultTableColumnModel model = new DefaultTableColumnModel(); JTableHeader tableHead = table.getTableHeader(); for (int c = 0; c < columnCount; c++) { //TableColumn column = table.getColumnModel().getColumn(c); //column.setModelIndex(order[c]); TableColumn column = new TableColumn(order[c]); column.setHeaderValue(tabl...

Nexus-7 and MAC address controlled Wi-Fi
When setting up a new Nexus-7, access to the Internet is required. However, you need to know the device's MAC address before you can connect to a MAC-address controlled Wi-Fi system. But, until the device is sewt up, you cannot use the Setting menu to find the MAC address, and it's not printed on the device or on the box. Crazy! (Yes, I found a way round this by disabling access control on the network, but that should not have been necessary. I thought you might like to know.) -- Cheers, David Web: http://www.satsignal.eu In news:l29sck$fva$1@dont-email.me Da...

Re: Matching records from data set one with records from data set #3
ec@SELVMORDSFORSKNING.DK wrote: >Hi > >I need to match records from data set one with records from data set two. I >can only match records from data set two to a single record in data set >one. >Therefore i need to delete the record in data set two or show that it has >been used, and thererfore can not be used again. Have do i do that? > >I have been trying some thing like this: > >Data newdataset; > set one; > found=0; > do i=1 to nobs until (found); > set two point=i nobs=nobs; > if var1=var2 (the matching criteria) ...

How do I preserve my display (brightness) setting?
Hi, I'm using Mac 10.6.3. Whenever I arrive in the morning, the brightness setting of the display is always turned down, even though I turned it all the way up the day before. How do I preserve this setting from day to day (between restarts)? - Dave In article <021c0b60-9566-4a56-a0f0-d49db0e48f73@u12g2000vbf.googlegroups.com>, "laredotornado@zipmail.com" <laredotornado@gmail.com> wrote: > Hi, > > I'm using Mac 10.6.3. Whenever I arrive in the morning, the > brightness setting of the display is always turned down, even though I > turned it ...

Displaying an image in a swing app
I'm attempting to display a pair of images in a swing gui. However, no matter what i try, the images just won't seem to display. What i'm trying to do is to subclass JPanel and use it to display the java.awt.Image resources. I am loading the images from jpeg files and using a MediaTracker to ensure that they're loaded. And then, when the panel's setImage() method is called, it is supposed to display the new image. However, it's not. It's displaying nothing whatsoever. I have tried a few tacks on this, up to and including replacing the JPanel subclass w...

how to set disk quotas in raid for linux
Hello groups i am looking up for seting disk quotas in raid for a linuz box.I donot know how to set the disk quotas in raid,so can u please assist me how to do it.Is there a documentation about that,if so where can i get it, Thanks in advance, Bye. Fri, 23 Jul 2004 07:36:08 -0700 tarihinde, rockwell dedi ki: > Hello groups i am looking up for seting disk quotas in raid for a > linuz box.I donot know how to set the disk quotas in raid,so can u > please assist me how to do it.Is there a documentation about that,if > so where can i get it, RAID has nothing to do with disk quotas. R...

logging module -> Miss messages if don't flush constantly? How set to flush constantly?
It looks like I can miss some logging messages if I don't flush after every one....is that true? This is an issue when program crashes so that logger didn't get a chance to print everything. Is there some way to set logging to constantly flush? Chris Seberino wrote: > It looks like I can miss some logging messages if I don't flush after > every one....is that true? As far as I can tell from the 2.6 source the StreamHandler does flush after each record. Peter ...

Re: How to filter sas data sets into separate sas data sets #6
First off, you don't need two set statements, I suspect you want a merge. (remember to sort datasets before merging) Data newlist (KEEP=node1 node2 node3 ... var15) Otherds (Keep=node1 node2 node3 .... var15) ; Merge sasds1 sasds2; By ;/*not sure which variable you need, but there has to be something that is the same between the two*/ What I'd really need to know is what are the field names in DS1 and DS2 (You described them but didn't tell us the names) You will possibly need a REANME= statement to get a matching name to merge by. Either read up more on merges and REN...

Running long script in the background
Hello, I am trying to write a python cgi that calls a script over ssh, the problem is the script takes a very long time to execute so Apache makes the CGI time out and I never see any output. The script is set to print a progress report to stdout every 3 seconds but I never see any output until the child process is killed. Here's what I have in my python script: command = "ssh -l root %s /scripts/xen/xen-create-win-vps1.sh %s" % (host, domuname) output = os.popen(command) for line in output: print line.strip() Here's a copy of the bash script. http://watters.ws/scrip...

Earth Simulator instruction set ?
Can anyone tell me what the Earth Simulator instruction set is like ? I had _assumed_ that it was SX like, but someone else is asserting that it's a MIPS ISA with the added vector units. I couldn't find anything definitive with googleto settle the discussion :-( Thanks -- -- Jim James Cownie <jcownie@etnus.com> Etnus, LLC. +44 117 9071438 http://www.etnus.com In article <GufLb.9883$9M4.109354178@news-text.cableinet.net>, James Cownie <jcownie@etnus.com> wrote: >Can anyone tell me what the Earth Simulator instruction set is like ? >I had _assumed_ tha...

Anyone need 4029 memory or Post Script boards?
I have two 512K (E410891409289) and one 1MB (R9020592011039142)memory boards, one Postscript (001D0412781183203) and one Postscript (P/N 1424015). The memory boards all have P/N 1039147 on the PCB. Chances are the 512K versions can be pumped up to 1MB by soldering eight more chips on, and adding a 74AC10 to the unpopulated U2 position. The memory chips are HM514256JP12, 256k x 4 General Purpose Dynamic RAM - Page Tcycl 65ns,PD stdby 1.7mW Otherwise, they are going for a dirt nap. Louis Ohland wrote: > Otherwise, they are going for a dirt nap. If no one else has a...

8 Pcs Brake Tool Set # ATE-4105
Price:$64.99 Image: http://discountadvisor.info/image.php?id=B001700GWO Best deal: http://discountadvisor.info/index.php?id=B001700GWO Contains The Most Popular Brake Tools Used For Servicing Drum Brakes On Many Import & Domestic VehiclesThree Different Style Brake Spoons: For adjusting Drum BrakesFive Diffrent Brake Spring Tools: For servicing drum brake shoes- Contains:1 Pc Brake Spring Pliers1 Pc Brake Spring Removal Tool (Fits 5/8" Diameter Spring)1 Pc Brake Spring Removel Tool (Fits Many Import Vehicles)1 Pc Brake Return Spring Removal Tool1 Pc Brake Spring Remov...

How to launch Displays with dead iBook screen?
Here's a toughie, a friend has an iBook or some Mac laptop running OS 10.3. The laptop screen is dead. If he plugs in an external monitor the Mac treats it as a second monitor to the right of the laptop screen. Any keyboard shortcut for mirroring the display? Any suggestion at all for this? thanks In article <arg-C466C6.22415113102005@newsclstr01.news.prodigy.com>, Bloomite <arg@aol.com> wrote: > Here's a toughie, a friend has an iBook or some Mac laptop running OS > 10.3. The laptop screen is dead. > > If he plugs in an external monitor the Mac tr...

Setting up VPN through Cisco 1721 and firewall
I'm fairly new to routing, so any help would be greatly appreciated. Network is configured as follows: Inside Network -> Watchguard Firewall -> Cisco 1721 -> Internet I need to setup VPN access using a Windows server, on our inside network (10.10.1.0). All NAT is done through the Firewall, and then routed to the 1721. We have a range of public IP addresses we can use. I've set up VPN on the server, and setup a port forwarding on the firewall for 1723 to our server (10.10.1.254). What I need help on is this: What do I need to do now so that somebody attempting to connec...

Converting a set to sequence?
Hi, just another query: is it possible to convert a set to sequence? The order of the elements does not matter. Michael Michael wrote: > is it possible to > convert a set to sequence? The order of > the elements does not matter. If S is the set then you need only do op(S); Preben Alsholm Thanks! That it, Michael Preben Alsholm wrote: > If S is the set then you need only do > > op(S); > > Preben Alsholm ...

US-IN-Indianapolis: Systems Admin,Win/NT/2K, Scripting, 3+yrs exp., SQL; 7M (45339149221)
US-IN-Indianapolis: Systems Admin,Win/NT/2K, Scripting, 3+yrs exp., SQL; 7M (45339149221) ========================================================================================= Position: Systems Admin Reference: SMC01956 Location: Indianapolis IN Duration: 7M Skills: 3+yrs exp Larger NT/Windows server farm experience Scripting High degree of personal initiative Project leadership Ability to support servers at multiple sites After-hours on-call support Activ...

How to Set Up Regression Model in SAS?
Hi all- There may be a very easy answer to this, but I just can't seem to figure it out... I want to test a regression model where the dependent variable is NOT at the "individual" level. I want to create a model to predict, for instance, quality of health (QOH) at the state level, not "individual" level by socio-economic status (SES) at the state level. Let's say I have data on 20 states, here's what the dataset would look like: Participant State SES_level_at_subj_level SES_at_state_level QOH_at_subj_level QOH_at_state_level 1 ...

How to set a COM Object property to TRUE
Hello, I am trying to set a WIN32 COM Object bool property true to enable a validation option. I can do it in VB like so. emailPtr.CorrectSyntax = True How do I do it in PERL? I have tried so many different things to no avail. $emailObj->{MxLookup} = (TRUE); $emailObj->{MxLookup} = $TRUE; $emailObj->{MxLookup} = 1; $emailObj->{MxLookup} = TRUE; Can anyone help? bmw108@gmail.com wrote: > Hello, > > I am trying to set a WIN32 COM Object bool property true to enable a > validation option. > > I can do it in VB like so. > > emailPtr.CorrectSyntax = T...

Display Word Document as read only in VI pannel
In a VI pannel I put an Active X container with the IE browser to display Word documents. The document are displayed properly but I want not give the user the possibility to make changes while viewing. Is there a solution to do so? (The documents are read-only and can not be saved.) Thanks for your support, Rather this is not the solution I need. When I place a Word document in a Active X container I am not able to change to another document programmatically (or is this al lack in my knowledge?) Placing a transparent control over the Active X container with the IE does not work. The container...

help set host/scsi
I use this to talk to the HSG80 controllers, why no HELP, it's been arou= nd for a while? HAFNER> sear sys$update:set.cld dbm150/win=3D2 ! X-47 DBM150 David B. Miller 12-Jan-1996 ! Add SET HOST/SCSI for StorageWorks Tom Linden wrote: > > I use this to talk to the HSG80 controllers, why no HELP, it's been around > for a while? > > HAFNER> sear sys$update:set.cld dbm150/win=2 > ! X-47 DBM150 David B. Miller 12-Jan-1996 > ! Add SET HOST/SCSI for StorageWorks Has not been officia...

Omit observations from transaction data set
Hi, I am using an update statement to replace the value of the variable "year" in my master data set by the value of "year" in my transaction data set. The transaction data set contains a few observations which are not in the master data set. I am not interested in including these observations in the new data set. Is it possible to omit these somehow? data temp; update master transaction; by a b c; run; Thanks, Helle Helle, Rather than update, try using modify. Check out the documentation for modify, specifically the differences between output and replace and ...