summaryrefslogtreecommitdiff
path: root/do-until.1
blob: ce52950993a2cb8ecc7ebfe4d12218dc71099b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.\" do-until.1 - manual page for the do-until command
.\" Copyright (C) 2008  Lars Wirzenius
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
.\"
.TH DO-UNTIL 1
.SH NAME
do-until \- repeat a command until it succeeds
.SH SYNOPSIS
.B do-until 
.RB [ -nv ]
.RB [ --no-act ]
.RB [ --verbose ]
.RB [ --max-tries = \fICOUNT ]
.RB [ --sleep = \fISECS ]
.RB [ -- ]
.I command
.IR arg ...
.SH DESCRIPTION
.B do-until
runs a command until it succeeds.
For example, the following invocation runs ssh until the login succeeds:
.sp 1
.nf
.RS
do-until ssh malich
.RE
.fi
.PP
.B do-until
sleeps for one second between invocations.
.PP
.B Note
that the shell expands wild card characters and performs input/output
redirections when the 
.B do-until
command is started, now then 
.B do-until
invokes the command it gets.
If this matters, you may need to invoke the command you need via
"sh -c 'foo > bar'" 
or some similar incantation.
See your shell manual for details.
.SH OPTIONS
.TP
.BR -h ", " --help
Write out a short usage summary.
.TP
.BR -n ", " --no-act
Do not run the command, just pretend to run it.
Also pretend it always succeeds.
.TP
.BR -v ", " --verbose
Write the command out before executing it.
.TP
.BR --sleep =\fISECS
Wait 
.I SECS 
seconds before re-trying a command. 
(Default is 1.)
.TP
.BR --max-tries =\fICOUNT
Try at most 
COUNT 
times, with 0 meaning forever. 
(Default is 0.)