Package: polysh
PolyshPolysh (formerly called Group Shell or gsh) is a remote shell multiplexer.
It lets you control many remote shells at once in a single shell.  Unlike
other commands dispatchers, it is interactive, so shells spawned on
the remote hosts are persistent.  It requires only a SSH server on the remote
hosts, or some other way to open a remote shell.Python >= 3.5 is required.Usage:polysh [OPTIONS]... HOSTS...PromptThepolyshprompt shows eitherready (X)>orwaiting (X/Y)>.
Thereadyprompt means that all enabled remote shells are ready to receive
commands and there are X such remote shells.  Failing that, thewaitingprompt 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.Commands prefixed by an exclamation mark are executed locally.  SignalsCtrl-CandCtrl-Dare forwarded to the remote shells.The prompt supports completion by pressing the Tab key.  Completion results
are taken from the command line history, paths from the local filesystem and
commands from the user$PATH.Hostnames with numbers can be generated bypolyshusing the<START-END>syntax.  The generated numbers will be zero padded according to the number
of zeroes in theSTARTandENDnumbers.Options–versionShow program`s version number and exit-h, –helpShow the help message and exit–hosts-file=FILERead hostnames from given file, one per lineHostnames 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.–command=CMDCommand to execute on the remote shellsThis startspolyshin
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.
Exit codes from the remote shells will be aggregated (taking the max)
to formpolysh’s exit code.–ssh=SSHCommand to use for SSHBy default,exec ssh -oLogLevel=Quiet -t %(host)s %(port)s.polyshspawns ssh for each connection which may spawn your default login
shell on the remote, 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)scan be inserted where the hostname should be placed.  Also, make
sure the command you use launches apty, this may need the-toption forssh.–user=USERRemote user to log in asWhen specified,polyshwill ssh toUSER@HOSTinstead of simply HOST.–no-colorDisable colored hostnames, enabled by defaultWhen specified,polyshwill not
use tty colors for the hostname prefix.–password-file=FILERead a password from the specified file-is the tty.  This can be
used when public key authentication is not available, either write
the password in a file, or set FILE to-so thatpolyshwill prompt
for a password.–log-file=LOG_FILEFile to log each machine conversationIf specified,polyshwill log all executed commands and their output in the file.  The logging
destination can be dynamically changed with the:set_logcontrol
command.–abort-errorsAbort if some shell fails to initializeBy default,polyshjust logs an error when it cannot successfully open a remote shell.
With this option, it exits with a failure.–debugPrint debugging informationUse this option to see exactly what is
transferred betweenpolyshand the remote shells.  This option can be
dynamically toggled using the:set_debugcommand in the control shell.Control CommandsControl commands are special purpose commands prefixed by a colon and
directed atpolyshitself instead of the remote shells.  These commands are::add NAMES…Add one or many remote shells:chdir LOCAL_PATHChange the current directory ofpolysh(not the remote shells):disable [SHELLS…]Disable sending commands to remote shellsIf the command would have
no effect, it changes all other shells to the inverse enable value.
That is, if you disable only already disabled shells, it will first
enable all other shells.  The special characters*,?, and[]work
as expected.:enable [SHELLS…]Enable sending commands to remote shells.  If the command would have
no effect, it changes all other shells to the inverse enable value.
That is, if you enable only already enabled shells, it will first
disable all other shells.  The special characters*,?, and[]work
as expected.:export_varsExport some environment variables on enabled remote shellsPOLYSH_NR_SHELLSis the total number of enabled shells.POLYSH_RANKuniquely identifies each shell with a number between0andPOLYSH_NR_SHELLS - 1.POLYSH_NAMEis the hostname as specified on
the command line andPOLYSH_DISPLAY_NAMEthe hostname as displayed
by:list(most of the time the same asPOLYSH_NAME).:hide_passwordDo not echo the next typed lineThis is useful when entering password.
If debugging or logging is enabled, it will be disabled to avoid
displaying a password. Therefore, you will have to re-enable logging or
debugging afterwards if need be.:list [SHELLS…]List remote shells and their statesThe output consists of:<hostname> <enabled?> <state>: <last printed line>.  The special
characters*,?, and[]work as expected.:purge [SHELLS…]Delete disabled remote shellsThis helps to have a shorter list.
The special characters*,?, and[]work as expected.:quitQuitpolysh:reconnect [SHELLS…]Try to reconnect to disconnected remote shellsThe special characters*,?, and[]work as expected.:rename [NEW_NAME]Rename all enabled remote shells with the argumentThe argument will
be shell expanded on the remote processes.  With no argument, the original
hostname will be restored as the displayed name.:reset_prompt [SHELLS…]Change the prompt to be recognized bypolyshThe special characters*,?, and[]work as expected.:send_ctrl LETTER [SHELLS…]Send a control character to remote shellsThe first argument is the control character to sendcord.  Note that
these control characters can also be sent simply by typing them.
The remaining optional arguments are the destination shells.  The special
characters*,?, and[]work as expected.:set_debug y|n [SHELLS…]Enable or disable debugging output for remote shellsThe first
argument isyto enable the debugging output,nto disable it.
The remaining optional arguments are the selected shells. The special
characters*,?, and[]work as expected.:set_log [LOCAL_PATH]Duplicate every console I/O into the given local fileIfLOCAL_PATHis not given, restore the default behaviour of not logging.:show_read_buffer [SHELLS…]Print the data read by remote shellsThe special characters*,?, and[]work as expected.HistoryThe tool is authored by Guillaume Chazarain <guichaz@gmail.com>.  The first
version released in 2006.  It has been maintained by InnoGames GmbH
since 2018.