HELP: How to set DISPLAY variable inside Solaris rsh command.

HELP: How to set DISPLAY variable inside Solaris rsh command.

Post by Heny Townsen » Fri, 03 Dec 2004 23:47:05




> I have a script on a Solaris platform which calls another script in a
> HPUX through the "rsh" command. I need to set the DISPLAY environment
> variable inside the rsh command before calling the HPUX script in the
> same rsh command.

> I can't let the script in the HPUX accept the DISPLAY as a paramter and
> set the DISPLAY inside the script as I've no control of the script.

> Both scripts runs in ksh.
> Anyone any idea on how to do it?

rsh foo DISPLAY=$DISPLAY command ...

The $DISPLAY is evaluated locally but exported remotely. It works.

--
Henry Townsend

 
 
 

HELP: How to set DISPLAY variable inside Solaris rsh command.

Post by cbf.. » Fri, 03 Dec 2004 22:27:55


I have a script on a Solaris platform which calls another script in a
HPUX through the "rsh" command. I need to set the DISPLAY environment
variable inside the rsh command before calling the HPUX script in the
same rsh command.

I can't let the script in the HPUX accept the DISPLAY as a paramter and
set the DISPLAY inside the script as I've no control of the script.

Both scripts runs in ksh.
Anyone any idea on how to do it?

Your help is appreciated.

Neil

 
 
 

HELP: How to set DISPLAY variable inside Solaris rsh command.

Post by Nathan Dietsc » Fri, 03 Dec 2004 22:48:55


Hello Nils,


> I have a script on a Solaris platform which calls another script in a
> HPUX through the "rsh" command. I need to set the DISPLAY environment
> variable inside the rsh command before calling the HPUX script in the
> same rsh command.

> I can't let the script in the HPUX accept the DISPLAY as a paramter and
> set the DISPLAY inside the script as I've no control of the script.

Can you set the DISPLAY environment variable before calling the script?
If so, then see below.

Quote:

> Both scripts runs in ksh.
> Anyone any idea on how to do it?

While I personally don't use rsh, this works using SSH from a Linux to a
Solaris 9 box


/export/home/njd/testscript'

Your DISPLAY variable is set to 333.333.333.333:0.0

The script looks like this



#!/bin/sh

echo "Your DISPLAY variable is set to $DISPLAY"

By including the ; you can separate the commands while still executing
them within the same environment.

I hope this helps. I would test it with rsh, but I don't use it in my
environment.

Regards,

Nathan Dietsch

 
 
 

HELP: How to set DISPLAY variable inside Solaris rsh command.

Post by cbfk » Sun, 05 Dec 2004 06:46:51



> Hello Nils,


> > I have a script on a Solaris platform which calls another script in a
> > HPUX through the "rsh" command. I need to set the DISPLAY environment
> > variable inside the rsh command before calling the HPUX script in the
> > same rsh command.

> > I can't let the script in the HPUX accept the DISPLAY as a paramter and
> > set the DISPLAY inside the script as I've no control of the script.

> Can you set the DISPLAY environment variable before calling the script?
> If so, then see below.

> > Both scripts runs in ksh.
> > Anyone any idea on how to do it?

> While I personally don't use rsh, this works using SSH from a Linux to a
> Solaris 9 box


> /export/home/njd/testscript'

> Your DISPLAY variable is set to 333.333.333.333:0.0

> The script looks like this



> #!/bin/sh

> echo "Your DISPLAY variable is set to $DISPLAY"

> By including the ; you can separate the commands while still executing
> them within the same environment.

> I hope this helps. I would test it with rsh, but I don't use it in my
> environment.

> Regards,

> Nathan Dietsch

Thanks Nathan, Unfortunately it doesn't work in my case.
Neil
 
 
 

HELP: How to set DISPLAY variable inside Solaris rsh command.

Post by cbfk » Sun, 05 Dec 2004 06:48:26




> > I have a script on a Solaris platform which calls another script in a
> > HPUX through the "rsh" command. I need to set the DISPLAY environment
> > variable inside the rsh command before calling the HPUX script in the
> > same rsh command.

> > I can't let the script in the HPUX accept the DISPLAY as a paramter and
> > set the DISPLAY inside the script as I've no control of the script.

> > Both scripts runs in ksh.
> > Anyone any idea on how to do it?

> rsh foo DISPLAY=$DISPLAY command ...

> The $DISPLAY is evaluated locally but exported remotely. It works.

Thanks. I tried and it did not work in my case.
Neil