Table of Contents

NAME

ch - change the host on which subsequent commands are to be executed

SYNOPSIS

ch [ -h | -V | -t ]
ch [ -t ] [ hostname ]

DESCRIPTION

This command allows you to quickly change to a designated host with the same execution environment. A simple shell is started that delivers all subsequent commands (except built-in commands) to the designated host for execution. The host from which ch command is started is called the home host, and the host that is currently connected is called the current work_ing host. If you specify hostname, all subsequent commands are executed on that host; otherwise, commands are executed on the home host (where the first ch command was executed). The following sequence of commands explains the behavior of the ch command:

(user is currently on host hostA)
% ch hostB
hostB> ch hostC
hostC> ch
hostA> ... ...

A ch command followed by nothing will change the current working host to home host.

When the simple shell starts, it is in the current working directory and has the same command execution environment as that of the parent shell. Every remotely dispatched command is executed with the same environment as that on the home host. The syntax of the ch command is similar to that of the Bourne shell. However, there are some important differences.

The ampersand ('&') following a command line (representing a background job in the Bourne shell) is ignored by ch. You can submit background jobs in ch with the built-in post command and bring them into the foreground with the built-in contact command (see below for details).

BUILT-IN COMMANDS

The ch command interprets the following built-in commands:

cd [ dir ]
Change the current working directory to dir. If dir is not specified, then the default is the user's home directory.

ch [ hostname ]
Change the current working host to hostname. If hostname is not specified, then the default is home host.

post [ command [ arg ... ] ]
Post the command for execution in the background on the current work_ing host. ch assigns a unique task ID to this command and displays this ID, then continues to interact with the user without waiting for the command to finish. However, the output of background jobs may disturb the screen. You can post multiple commands on one host or on different hosts. When a previously posted command is completed, ch reports its status to the standard error. If the command is not specified, then ch prints all currently running background commands.

contact taskID
Bring a previously posted background command into the foreground. taskID is the ID returned by the post command. Standard input is now passed to this foreground command. You cannot put an active foreground job into the background. A command that has been brought into the foreground with contact cannot be put back into the background.

exit Exit ch if there are no posted commands running. Typing an EOF character (usually control-D but may be set otherwise, see stty(1) ) forces ch to exit; uncompleted posted commands are killed.

ch recognizes a ~ (tilde) as a special pathname. If a ~ (tilde) is followed by a space, tab, newline or / (slash) character, then the ~ character is translated into the user's home directory. Otherwise, the ~ is translated as the home directory of the user name given by the string following the ~ character.

Pipelines, lists of commands and redirection of standard input/output are all handled by invoking /bin/sh.

OPTIONS

-t Turn on the timing option. The amount of time each subsequent command takes to execute is displayed. The default is not to display execution time.

-h Print command usage to stderr and exit.

-V Print LSF release version to stderr and exit.

LIMITATIONS

For the time being, the ch command does not support script, history, and alias. The ch prompt is always the current working host:current working directory followed by a > (right angle bracket) character. If the ch session is invoked by a shell that supports job control (such as tcsh or ksh), Control-Z suspends the whole ch session. The exit status of a command line is printed to stderr if the status is non-zero.

SEE ALSO

lstcsh(1) , lsrun(1) , rsh(1) , stty(1)


Table of Contents