1gsh(1) Remote shells gsh(1)
2
3
4
6 gsh - Group Shell
7
9 gsh [OPTIONS]... HOSTS...
10
12 gsh spawns many remote shells at once and allows to manage them in a
13 single interface.
14
16 The gsh prompt shows either 'ready (X)> ' or 'waiting (X/Y)> '. The
17 'ready' prompt means that all enabled remote shells are ready to
18 receive commands and there are X such remote shells. Failing that, the
19 'waiting' prompt is shown, meaning that X remote shells are not yet
20 ready to receive commands. Either way, all the readline editing fea‐
21 tures like navigation in the history, searching in the history, and
22 completion are available.
23
24 Commands prefixed by an exclamation mark are executed locally.
25
26 Signals like Ctrl-C and Ctrl-Z sent to gsh are forwarded to the remote
27 shells.
28
30 The gsh prompt supports completion by pressing the Tab key. Completion
31 results are taken from the command line history, paths from the local
32 filesystem and commands from the user $PATH.
33
35 Host names with numbers can be generated by gsh using the <START-END>
36 syntax. The generated numbers will be zero padded according to the num‐
37 ber of zeroes in the START and END numbers.
38
40 --version
41 Show program's version number and exit.
42
43 -h, --help
44 Show the help message and exit.
45
46 --hosts-file=FILE
47 Read hostnames from given file, one per line. Hostnames are
48 given on the command line, but they can also be read from files.
49 The format is one hostname per line, '#' comments and blank
50 lines are skipped.
51
52 --command=CMD
53 Command to execute on the remote shells. This starts gsh in
54 non-interactive mode. It will start the remote shells, send the
55 command, print the output and exit when the command is completed
56 on all remote shells. This is the same as piping a command on
57 the standard input.
58
59 --ssh=SSH
60 Ssh command to use [ssh -t %(host)s bash --noprofile]. By
61 default, gsh spawns lightweight remote shells using the ssh com‐
62 mand, but another shell command can be specified here. For exam‐
63 ple, with --ssh='usleep $((RANDOM*50)); exec ssh' a delay will
64 be introduced to avoid all hosts accessing a NFS server at the
65 same time. If the hostname should not be added at the end of the
66 command, the macro %(host)s can be inserted where the hostname
67 should be placed. Also, make sure the command you use launchs a
68 pty, this may need the -t option for ssh.
69
70 --log-file=LOG_FILE
71 File to log each machine conversation [none]. If specified, gsh
72 will log all executed commands and their output in the file. The
73 logging destination can be dynamically changed with the :set_log
74 control command.
75
76 --abort-errors
77 Abort if some shell fails to initialize [ignore]. By default,
78 gsh just logs an error when it cannot succesfully open a remote
79 shell. With this option, it exits with a failure.
80
81 --debug
82 Print debugging information. Use this option to see exactly what
83 is transferred between gsh and the remote shells. This option
84 can be dynamically toggled using the set_debug command in the
85 control shell.
86
88 Control commands are special purpose commands prefixed by a colon and
89 directed at gsh itself instead of the remote shells. These commands
90 are:
91
92
93 :add NAMES...
94 Add one or many remote shells.
95
96 :chdir LOCAL_PATH
97 Change the current directory of gsh (not the remote shells).
98
99 :disable [SHELLS...]
100 Disable sending commands to remote shells. The special charac‐
101 ters * ? and [] work as expected.
102
103 :enable [SHELLS...]
104 Enable sending commands to remote shells. The special characters
105 * ? and [] work as expected.
106
107 :export_rank
108 Set GSH_RANK and GSH_NR_SHELLS on enabled remote shells. The
109 GSH_RANK shell variable uniquely identifies each shell with a
110 number between 0 and GSH_NR_SHELLS - 1. GSH_NR_SHELLS is the
111 total number of enabled shells.
112
113 :help [COMMAND]
114 List control commands or show their documentations.
115
116 :hide_password
117 Do not echo the next typed line. This is useful when entering
118 password. If debugging or logging is enabled, it will be dis‐
119 abled to avoid displaying a password. Therefore, you will have
120 to reenable logging or debugging afterwards if need be.
121
122 :list [SHELLS...]
123 List remote shells and their states. The output consists of:
124 <hostname> <enabled?> <state>: <last printed line>. The special
125 characters * ? and [] work as expected.
126
127 :purge [SHELLS...]
128 Delete disabled remote shells. This helps to have a shorter
129 list. The special characters * ? and [] work as expected.
130
131 :quit Quit gsh.
132
133 :reconnect [SHELLS...]
134 Try to reconnect to disconnected remote shells. The special
135 characters * ? and [] work as expected.
136
137 :rename [NEW_NAME]
138 Rename all enabled remote shells with the argument. The argument
139 will be shell expanded on the remote processes. With no argu‐
140 ment, the original hostname will be restored as the displayed
141 name.
142
143 :replicate SHELL:REMOTE_PATH
144 Copy a path from one remote shell to all others
145
146 :reset_prompt [SHELLS...]
147 Change the prompt to be recognized by gsh. The special charac‐
148 ters * ? and [] work as expected.
149
150 :send_ctrl LETTER [SHELLS...]
151 Send a control character to remote shells. The first argument is
152 the control character to send like c, d or z. Note that these
153 three control characters can be sent simply by typing them into
154 gsh. The remaining optional arguments are the destination
155 shells. The special characters * ? and [] work as expected.
156
157 :set_debug y|n [SHELLS...]
158 Enable or disable debugging output for remote shells. The first
159 argument is 'y' to enable the debugging output, 'n' to disable
160 it. The remaining optional arguments are the selected shells.
161 The special characters * ? and [] work as expected.
162
163 :set_log [LOCAL_PATH]
164 Duplicate every console I/O into the given local file. If
165 LOCAL_PATH is not given, restore the default behaviour of not
166 logging.
167
168 :show_read_buffer [SHELLS...]
169 Print the data read by remote shells. The special characters * ?
170 and [] work as expected.
171
172 :upload LOCAL_PATH
173 Upload the specified local path to enabled remote shells.
174
175
177 Guillaume Chazarain <guichaz@gmail.com>
178 See http://guichaz.free.fr/gsh
179
180
181
182Guillaume Chazarain 0.3 gsh(1)