| hostgrep(1) | General Commands Manual | hostgrep(1) |
hostgrep - print lines matching hostlist
hostgrep [OPTION]... HOSTLIST [FILE]...
Search the files for lines matching the given hostlist. If no files are given, search the standard input.
For each line, the program tries to find all hostnames and hostlists. Hostlists are then expanded to hostnames. The set of hostnames in a line is then compared to the set of hostnames given by the HOSTLIST on the command line. By default, the line is printed if any hostname from the HOSTLIST is found in the line.
The program has a rather naive notion of what constitutes hostnames and hostlist.
For version 1.21 and earlier, hostnames were allowed to contain exactly upper and lower case A-Z and the digits 0-9. This meant that you could not grep for names like "rack02-pos13". From version 1.22, the code dynamically adds additional characters from the hostlist provided on the command line, so that it will work to grep for hostnames containing those characters.
Written by Kent Engström <kent@nsc.liu.se>.
The program is published at http://www.nsc.liu.se/~kent/python-hostlist/
hostlist (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 (https://computing.llnl.gov/linux/pdsh.html).
See the HOSTLIST EXPRESSIONS section of the pdsh(1) manual page for a short introduction to the hostlist syntax.
| Version 2.2.1 |