Skip to content

Commit f9a96b0

Browse files
committedOct 15, 2020
README.md fixes
1 parent 0089497 commit f9a96b0

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed
 

‎README.md

+34-9
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Usage:
88
$ vlbish [options] [-c "command" [-c "command"]] [path/to/script [arg1 arg2 ... argN]]
99
```
1010
11-
see 'vlbish --help' for [options] or 'vlbish --usage' for an extended help.
11+
see `vlbish --help` for [options] or `vlbish --usage` for an extended help.
1212
As always, anything in `[]` means it's optional.
1313
14-
`vlbish` can be scripted. This repository includes [some useful examples](examples/).
15-
directory directory
14+
`vlbish` can be scripted. This repository includes some useful examples in the [examples](examples/) directory.
15+
1616
1717
## Options:
1818
--help show short help
@@ -34,31 +34,56 @@ There are three (3) formats for a line of input:
3434
3535
- [`<selection>`] `/ commands`
3636
37-
(attempts to) send the VSI/S commands to all machines in <selection> using TCP/IP
37+
(attempts to) send the VSI/S commands to all machines in \<selection> using TCP/IP. If no selection specified sends the command(s) to the last-used selection (if any).
3838
3939
- [`<selection>`] `! shell commands`
4040
41-
(attempts to) execute the shell commands on all machines in <selection> using ssh if no selection given uses last-known selection
41+
(attempts to) execute the shell commands on all machines in \<selection> using ssh. If no selection specified sends the command(s) to the last-known selection (if any).
4242
4343
- `commands`
4444
4545
if recognized as vlbish built-in command, executes as that, otherwise interpreted as VSI/S and sent to last-known selection using TCP/IP
4646
47-
In this version of vlbish it is possible to put multiple 'logical' lines of
48-
input on one physical line of input (all characters up to and including the
49-
newline) by separating the logical lines with two or more semicolons:
47+
`vlbish` remembers/reuses the last-known selection and displays it in the prompt. The selection remains 'active' until it is modified using a version of the syntax which specifies a (new) selection.
48+
49+
In this version of vlbish it is possible to put multiple 'logical' lines of input on one physical line of input (all characters up to and including the newline) by separating the logical lines with two or more semicolons:
5050
5151
```
5252
> 0/tstat?;; sleep 2;; 0!uname -a
5353
```
5454
5555
is now interpreted and executed as if three separate lines of input were given: a VSI/S command, a vlbish builtin command and a shell command.
5656
57-
vlbish has lots of built-in knowledge to resolve <selection> into user/ip/port tuples. It also connects to the database @JIVE in order to resolve names and associations and equipment types. It is possible to set options in <selection> affecting the execution of <commands> (see below).
57+
vlbish has lots of built-in knowledge to resolve \<selection> into user/ip/port tuples. It also connects to the database @JIVE in order to resolve names and associations and equipment types. It is possible to set options in \<selection> affecting the execution of \<commands> (see below).
5858
5959
6060
default ports used:
6161
6262
`<VSI/S command>` = 2620 [mark5 control port]
6363
6464
`<shell command>` = 22 [ssh]
65+
66+
67+
## template commands
68+
69+
With the possibility of setting options on hosts, generic scripting becomes possible.
70+
71+
Define aliases for two hosts. Both have the same `mtu` option set, but to different values:
72+
73+
```bash
74+
alias sender host1.domain.com:4004,mtu=2500
75+
alias receiver 192.168.1.2:8008,mtu=9000
76+
```
77+
78+
Suppose the `set_mtu=...` command exists that can be sent to a host to set a specific MTU value, it can now be done for both (or individual) hosts like below; the command engine inside `vlbish` replaces strings of the form `{key}` in the command with the value for that `key` from the options set for a particular host:
79+
80+
```basn
81+
> sender,receiver/set_mtu={mtu}
82+
```
83+
84+
An elaborate use case can be found in the [rdbe_10g_init.scr](examples/rdbe_10g_init.scr) example - using that script several machines can be configured with their respective IP/ethernet configuration.
85+
86+
Note that in script files double `{{ ... }}` braces are needed to escape the first level of string substitution.
87+
Lines in scripts are "template" commands for the script parser inside `vlbish` - arguments can be passed to scripts and strings of the form `{N}` (N is a number >= 0) are replaced by the scripts' arguments, with the first *argument* having index 0.
88+
89+
The engine is not yet smart enough to disambiguate between `{N}` and `{key}`

0 commit comments

Comments
 (0)
Please sign in to comment.