annotate master/bin/wbash.sh @ 9:55e953e5c66f

wrun.sh, invoke.sh: add control of use of nohup, with -i(mmediately) and -w(ait) respectively wrun.sh: add support for fixed file input via -ff, handle -ff - in obvious way wbash.sh: use -ff - and -i to execute shell commands on all workers
author Henry S. Thompson <ht@markup.co.uk>
date Tue, 02 Oct 2018 10:52:45 +0000
parents
children 9275e2a8b5e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
1 #!/bin/bash
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
2 if [ $# -lt 1 ]
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
3 then
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
4 cat 1>&2 <<EOF
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
5 Usage: cat cmds | $0 SSname [...args]
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
6 Where SSname is the name of a VM scale set.
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
7
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
8 Runs bash [with args] on every machine in a scale set,
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
9 on commands from stdin
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
10 by doing as it were
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
11 cat | ssh machine "bash \$args"
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
12 EOF
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
13 exit 1
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
14 fi
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
15 ss=$1
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
16 shift
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
17 wrun.sh $ss bash -x -ff - -i "$@" '\<ifile.txt'