Solved

Run multiple commands within rsh command

Posted on 2010-09-15
11
969 Views
Last Modified: 2012-05-10
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
Comment
Question by:lostinspace9
  • 6
  • 5
11 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 33682146
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
 

Author Comment

by:lostinspace9
ID: 33683139
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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 33683219
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:lostinspace9
ID: 33683238
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
 

Author Comment

by:lostinspace9
ID: 33683253
That should be  /usr/bin/X11/dxcalendar
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 33683378
There's some problem most probably not related to rsh.
What happens when you start dxcalendar locally?
0
 

Author Comment

by:lostinspace9
ID: 33683623
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
 

Author Comment

by:lostinspace9
ID: 33683685
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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 33683692
Again, not related to rsh.
What does oclock display when started locally?
And doesn't oclock open its own window? Why xterm?
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 33683718
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
 

Author Closing Comment

by:lostinspace9
ID: 33683756
For what I was asking everything was great.  I learned several things.

Thanks
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem Imaging Computers With Clonezilla 2 90
Unistall fileset without dependecies on AIX 3 67
how to check for shares on aix 1 79
How to clone solaris 10 machine 33 131
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question