HPlogo Using the X Window System > Chapter 8 Using the X Clients

Starting Remote Programs

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

A remote client is a client that runs on a computer other than the computer running the X server. In other words, a remote client runs on one computer while its output is displayed on another.

There are several ways to run programs on a remote host from a command line:

  • Use rlogin to log into the remote host.

  • Use remsh to start a client remotely without formally logging in.

If the client produces output on a display, you must specify the display and screen on which you want the output to appear.

Running Programs Using `rlogin'

You can use an existing terminal emulator window to log into a remote host. Once the window is acting as a terminal off the remote host, you can run clients there and direct the output to any display.

For example, the following commands log into and start xload on remote host hpthere and display the output on local system hpxhere.

   rlogin  hpthere

   xload  -display  hpxhere:0.0 & 

Using `remsh' to Start Programs

The benefit of using remsh instead of rlogin is that the the local system starts only one process (the client) with a remote shell; with the remote login, the local system starts both the remote login and the client.

Starting Clients Remotely

The following syntax starts a remote shell on a remote host, redirects remsh input, starts a client, and directs output to the local display.

remsh remote -n client -display local:display.screen &

remote

The remote host name.

client

Absolute path of the executable client file (remsh does not allow the PATH variable).

local

Local host name.

For example, the following command runs xload on remote host hpthere and directs output to the display of system hpxhere.

   remsh hpthere -n /usr/bin/X11/xload -display hpxhere:0.0 &

Generally, remsh is preferred to rlogin for starting a remote program from a menu. For example, the following line added to the workspace menu starts a remote hpterm window on remote host hpthere:

   "Doc files"  f.exec "remsh hpthere -n /usr/bin/X11/hpterm -display hpxhere:0.0 & 

Starting a Remote Non-Client

At the command-line prompt of an existing window, you could execute:

   hpterm -display hpxhere:0.0 -e remsh hpthere -n ll &

This example starts a new hpterm client and directs its output to the local display (-display hpxhere). The -e option executes a remote shell on hpthere that connects the window to the remote host hpthere and lists the files in your home directory there. When the ll command finishes executing, the window created for it to run in will disappear. Thus, this method of starting remote non-clients is usually not desirable.

© 1995 Hewlett-Packard Development Company, L.P.