pshbak - format output from pdsh command
pshbak formats output from parallel shells such as
pdsh and dsh, into a more readable output. It can be used as a
drop-in replacement for dshbak.
Output from pdsh, where each line is prefixed by a hostname
followed by a colon, is read via stdin, collected per hostname, and printed
in a per hostname fashion. With the often used -c option, hosts
having identical output are collected and the output is printed only
once.
- -c, --collect
- Collect hosts having identical output and make the identical output appear
to only once. The collected hostlist representing the nodes is shown in
the header before the output.
- -d, --unified-diff
- Print only the most frequent output in full. Then print any diverging
output as a unified diff relative the most frequent output. This mode of
operation implies the --collect option
- -C,
--collect-similar
- Collect hosts having relatively similar output, and print the identical
part of the output only once. The parts of the output which differs among
the hosts are replaced with enumerated tags ([DIFF1], [DIFF2], ...). For
two outputs to be considered relatively similar, they must contain the
same number of lines, and in total, the lines must not be too different.
The differences can be printed using either the --format-diff or
the --spliced-diff option.
- --spliced-diff
- When using --collect-similar, lines containing differences are
prefixed by its hostname and printed together with the collected part of
the output.
- --no-collected
- When using --collect-similar, don't print the collected part. This
is intended to be useful together with the --format-diff
option.
- --format-diff
FORMAT
- When using --collect-similar, after to collected part, format and
print the differences for each host as specified by FORMAT.
FORMAT is expected to be a text string containing zero or more
occurrences of $h, $1, $2, $3..., which in the output will be replaced by
hostname, DIFF1, DIFF2, DIFF3, etc.
- -n, --count
- Show the number of hosts in the header (before the hostlist).
- -g, --with-garbage
- Also print any output not conforming to the "host:output" format
in a special NON-FORMATTED OUTPUT section before the correctly
formatted data. The default mode of operation is to silently ignore
non-conforming lines.
- --color
[yes|no]
- Control whether ANSI color codes should be used. The default behavior is
to enable ANSI color codes when writing to a normal tty, and disable it
otherwise.
- -h, --help
- Display a brief help message.
Written by Mattias Slabanja <slabanja@chalmers.se>.
The program is published at
http://www.nsc.liu.se/~kent/python-hostlist/
hostlist(1), pdsh(1), dshbak(1)
The hostlist expression syntax is used by several programs
developed at LLNL (https://computing.llnl.gov/linux/), for example
SLURM (https://computing.llnl.gov/linux/slurm/) and Pdsh
(http://code.google.com/p/pdsh/).
See the HOSTLIST EXPRESSIONS section of the pdsh(1)
manual page for a short introduction to the hostlist syntax.