Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1111
  • Last Modified:

Run multiple commands within rsh command

I am trying to run the following rsh command but cannot get it to work properly.  A xterm and dxclock come up but it is on the server I issued the rsh on.  This command is ran from root.

rsh server2 setenv DISPLAY server2:0.0 ; /usr/bin/X11/xterm -e dxclock

Note: I will be running a c-shell script instead of dxclock.
0
lostinspace9
Asked:
lostinspace9
  • 6
  • 5
1 Solution
 
woolmilkporcCommented:
Is this a duplicate question?
In the other thread i advised you to use single quotes -
rsh server2 'setenv DISPLAY server2:0.0 ; /usr/bin/X11/xterm -e dxclock'
 
0
 
lostinspace9Author Commented:
It is not a duplicate question, I had some browser issues and might have sent it a second time.  Your suggestion works partly.  However, I get the following message in the new xterm:  Can't execvp dxclock.
0
 
woolmilkporcCommented:
Seems that dxclock is not in the PATH.
Please note that with rsh no shell initialization profile is executed.
Try dxclock with its full path!
wmp
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
lostinspace9Author Commented:
Forget my last comment.  I checked and found out that dxclock does not exist on the serve I am working with.  However, when I run the command using one that does (/use/bin/X11/dxcalendar) the xterm pops up but immeditaly goes away without displaying the calendar.
0
 
lostinspace9Author Commented:
That should be  /usr/bin/X11/dxcalendar
0
 
woolmilkporcCommented:
There's some problem most probably not related to rsh.
What happens when you start dxcalendar locally?
0
 
lostinspace9Author Commented:
I found that dxcalendar needs to be setup on the remote server.  I don't care about setting up dxcalendar so what I did was to find a X11 program that does work on the remote server (/usr/bin/X11/oclock).  When I run the command now the xterm pops up with the title of oclock but the actual clock does not display.  Below is the command I ran:

rsh server2 'setenv DISPLAY server2:0.0 ; /usr/bin/X11/xterm -e oclock'
0
 
lostinspace9Author Commented:
This is killing me...I ran it a second time and it worked.  My problem is a bit more complex than I thought and  deals with python and with a gnuplot wrapper.  I have to gather more information.  Do you want me to close this question or do you want to wait a bit until I can give more data concerning my problem?
0
 
woolmilkporcCommented:
Again, not related to rsh.
What does oclock display when started locally?
And doesn't oclock open its own window? Why xterm?
0
 
woolmilkporcCommented:
I fear I will not be able to help you with Python.
So it would actually be better to open a new question in the Python zone.
0
 
lostinspace9Author Commented:
For what I was asking everything was great.  I learned several things.

Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now