Added the :print_read_buffer control command to see what gsh just read
[polysh.git] / gsh.1
blob050818e1652eb990a215c0d20dd48aa9f183c5a1
1 .TH "gsh" "1" "0.3" "Guillaume Chazarain" "Remote shells"
2 .SH "NAME"
3 gsh \- Group Shell
4 .SH "SYNOPSIS"
5 \fBgsh\fR [OPTIONS]... HOSTS...
6 .SH "DESCRIPTION"
7 \fIgsh\fR spawns many remote shells at once and allows to manage them in a single interface.
8 .SH "PROMPTS"
9 The \fIgsh\fR prompt shows either 'ready (X)> ' or 'waiting (X/Y)> '. The 'ready' prompt means that all enabled remote shells are ready to receive commands and there are X such remote shells. Failing that, the 'waiting' prompt is shown, meaning that X remote shells are not yet ready to receive commands. Either way, all the readline editing features like navigation in the history, searching in the history, and completion are available.
11 Commands prefixed by an exclamation mark are executed locally.
13 Signals like Ctrl\-C and Ctrl\-Z sent to \fIgsh\fR are forwarded to the remote shells.
14 .SH "COMPLETION"
15 The \fIgsh\fR prompt supports completion by pressing the Tab key. Completion results are taken from the command line history, absolute paths from the local filesystem and commands from the user $PATH.
16 .SH "HOST NAMES EXPANSION"
17 Host names with numbers can be generated by gsh using the <START\-END> syntax. The generated numbers will be zero padded according to the number of zeroes in the START and END numbers.
18 .SH "OPTIONS"
19 .TP 
20 \fB\-\-version\fR
21 Show program's version number and exit.
22 .TP 
23 \fB\-h, \-\-help\fR
24 Show the help message and exit.
25 .TP 
26 \fB\-\-hosts\-file=FILE\fR
27 Read hostnames from given file, one per line. Hostnames are given on the command line, but they can also be read from files. The format is one hostname per line, '#' comments and blank lines are skipped.
28 .TP 
29 \fB\-\-command=CMD\fR
30 Command to execute on the remote shells. This starts \fIgsh\fR in non\-interactive mode. It will start the remote shells, send the command, print the output and exit when the command is completed on all remote shells. This is the same as piping a command on the standard input.
31 .TP 
32 \fB\-\-ssh=SSH\fR
33 Ssh command to use [ssh]. By default, \fIgsh\fR spawns remote shells using the ssh command, but another shell command can be specified here. For example, with \-\-ssh='usleep $((RANDOM*50)); exec ssh' a delay will be introduced to avoid all hosts accessing a NFS server at the same time. If the hostname should not be added at the end of the command, the macro %(host)s can be inserted where the hostname should be placed. Also, make sure the command you use launchs a pty, this may need the \-t option for ssh.
34 .TP 
35 \fB\-\-log\-file=LOG_FILE\fR
36 File to log each machine conversation [none]. If specified, \fIgsh\fR will log all executed commands and their output in the file. The logging destination can be dynamically changed with the :log_output control command.
37 .TP 
38 \fB\-\-abort\-errors\fR
39 Abort if some shell fails to initialize [ignore]. By default, \fIgsh\fR just logs an error when it cannot succesfully open a remote shell. With this option, it exits with a failure.
40 .TP 
41 \fB\-\-debug\fR
42 Print debugging information. Use this option to see exactly what is transferred between \fIgsh\fR and the remote shells. This option can be dynamically toggled using the set_debug command in the control shell.
43 .SH "CONTROL COMMANDS"
44 Control commands are special purpose commands prefixed by a colon and directed at \fIgsh\fR itself instead of the remote shells. These commands are:
45 \" BEGIN AUTO-GENERATED CONTROL COMMANDS DOCUMENTATION
46 .TP
47 \fB:add NAMES...\fR
48 Add one or many remote shells.
49 .TP
50 \fB:chdir PATH\fR
51 Change the current directory of \fIgsh\fR (not the remote shells).
52 .TP
53 \fB:disable [SHELLS...]\fR
54 Disable sending commands to remote shells. The special characters * ? and [] work as expected.
55 .TP
56 \fB:enable [SHELLS...]\fR
57 Enable sending commands to remote shells. The special characters * ? and [] work as expected.
58 .TP
59 \fB:export_rank\fR
60 Set GSH_RANK and GSH_NR_SHELLS on enabled remote shells. The GSH_RANK shell variable uniquely identifies each shell with a number between 0 and GSH_NR_SHELLS - 1. GSH_NR_SHELLS is the total number of enabled shells.
61 .TP
62 \fB:help [COMMAND]\fR
63 List control commands or show their documentations.
64 .TP
65 \fB:hide_password\fR
66 Do not echo the next typed line. This is useful when entering password. If debugging or logging is enabled, it will be disabled to avoid displaying a password.
67 .TP
68 \fB:list [SHELLS...]\fR
69 List remote shells and their states. The special characters * ? and [] work as expected.
70 .TP
71 \fB:log_output [PATH]\fR
72 Duplicate every console output into the given local file. If PATH is not given, restore the default behaviour of not logging the output.
73 .TP
74 \fB:print_read_buffer [SHELLS...]\fR
75 Print the data read by remote shells. The special characters * ? and [] work as expected.
76 .TP
77 \fB:purge [SHELLS...]\fR
78 Delete disabled remote shells. This helps to have a shorter list. The special characters * ? and [] work as expected.
79 .TP
80 \fB:quit\fR
81 Quit \fIgsh\fR.
82 .TP
83 \fB:reconnect [SHELLS...]\fR
84 Try to reconnect to disconnected remote shells. The special characters * ? and [] work as expected.
85 .TP
86 \fB:rename [NEW_NAME]\fR
87 Rename all enabled remote shells with the argument. The argument will be shell expanded on the remote processes. With no argument, the original hostname will be restored as the displayed name.
88 .TP
89 \fB:replicate SHELL:path\fR
90 Copy a path from one remote shell to all others
91 .TP
92 \fB:reset_prompt [SHELLS...]\fR
93 Change the prompt to be recognized by \fIgsh\fR. The special characters * ? and [] work as expected.
94 .TP
95 \fB:send_ctrl LETTER [SHELLS...]\fR
96 Send a control character to remote shells. The first argument is the control character to send: c, d or z. The remaining optional arguments are the destination shells. The special characters * ? and [] work as expected.
97 .TP
98 \fB:set_debug y|n [SHELLS...]\fR
99 Enable or disable debugging output for remote shells. The first argument is 'y' to enable the debugging output, 'n' to disable it. The remaining optional arguments are the selected shells. The special characters * ? and [] work as expected.
100 \" END AUTO-GENERATED CONTROL COMMANDS DOCUMENTATION
101 .SH "AUTHOR"
102 Guillaume Chazarain <guichaz@gmail.com>
103 .br 
104 See http://guichaz.free.fr/gsh