diff --git a/tsshbatch.rst b/tsshbatch.rst index 1b53af2..8b69006 100644 --- a/tsshbatch.rst +++ b/tsshbatch.rst @@ -670,29 +670,30 @@ Now, all you have to do is this:: - tsshbatch.py -xH "host 1 host2" -P "myfile. ./" + tsshbatch.py -xH "host 1 host2" -P "myfile.__HOSTNAME__ ./" When run, ``tsshbatch`` will substitute the name of the current - host in place of the string ````. + host in place of the string ``__HOSTNAME__``. (*Note that these + are **double** underbars on each side of the string.*) You can do this in commands (and commands within command files) as well:: - tsshbatch -x hosts 'echo I am running on ' + tsshbatch -x hosts 'echo I am running on __HOSTNAME__' Be careful to escape and quote things properly, especially from the the command line, since ``<`` and ``>`` are recognized by the shell as metacharacters. There are two forms of host name substitution possible. The first, - ```` will use the name *as you provided it*, either as + ``__HOSTNAME__`` will use the name *as you provided it*, either as an argument to ``-H`` or from within a host file. - The second, ````, will only use the portion of the name + The second, ``__HOSTSHORT__``, will only use the portion of the name string you provided up to the leftmost period. - So, if you specify ``myhost1.frumious.edu``, ```` will be - replaced with that entire string, and ```` will be replaced + So, if you specify ``myhost1.frumious.edu``, ``__HOSTNAME__`` will be + replaced with that entire string, and ``__HOSTSHORT__`` will be replaced by just ``myhost1``. Notice that, in no case does ``tsshbatch`` do any DNS lookups to @@ -797,7 +798,7 @@ :: - $Id: tsshbatch.rst,v 1.140 2014/12/02 18:14:03 tundra Exp $ + $Id: tsshbatch.rst,v 1.141 2014/12/02 20:19:35 tundra Exp $ You can find the latest version of this program at: