- 论坛徽章:
- 15
|
dsy851009 发表于 2012-11-07 12:38
#!/usr/bin/env bash
自己要先看一下帮助- man pdsh
- -w TARGETS,...
- Target and or filter the specified list of hosts. Do not use with any other node selection options (e.g. -a, -g, if they are available). No spaces are allowed in the comma-separated list. Arguments in the TARGETS list may include normal host names, a range of hosts in hostlist format (See HOSTLIST EXPRESSIONS), or a single '-' character to read the list of hosts on stdin.
- If a host or hostlist is preceded by a '-' character, this causes those hosts to be explicitly excluded. If the argument is preceded by a single '^' character, it is taken to be the path to file containing a list of hosts, one per line. If the item begins with a '/' character, it is taken as a regular expression on which to filter the list of hosts (a regex argument may also be optionally trailed by another '/', e.g. /node.*/). A regex or file name argument may also be preceeded by a minus '-' to exclude instead of include thoses hosts.
复制代码 A list of hosts may also be preceded by "user@" to specify a remote username other than the default, or "rcmd_type:" to specify an alternate rcmd connection type for these hosts. When used together, the rcmd type must be specified first, e.g. "ssh:user1@host0" would use ssh to connect to host0 as user "user1."- $@
- 与$*同义,但是每个参数都是一个独立的""引用字串,这就意味着参数被完整地传递,并没有被解释和扩展.这也意味着,每个参数列表中的每个参数都被当成一个独立的单词.
- 注意:"$@"必须被""引用.
复制代码 |
|