This is the mail archive of the
mailing list for the Cygwin project.
Re: How to repeat a bash shell script until success
- From: Kaz Kylheku <920-082-4242 at kylheku dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 14 Jul 2017 10:07:29 -0700
- Subject: Re: How to repeat a bash shell script until success
- Authentication-results: sourceware.org; auth=none
- References: <97021E71-D804-42AF-8358-6276AF4514AB@gmail.com>
On 12.07.2017 08:35, Bryan Dunphy wrote:
I have a shell script, originally created for Mac OS X. that waits for
an external drive to be mounted (by testing an “ls” of the volume’s
root directory for success) then runs an “rsync”
command. How do I get the script to be run repeatedly until
successful exit under Cygwin?
while ! program arg1 arg2 ...
: # explicit null statement: syntactically mandatory!
one-liner: semicolon between program and "do",
semicolon between : statement and "done":
while ! program arg1 arg2 ... ; do : ; done
The space between ! and the command is required.
I would throw a sleep in there, not to create a CPU-intensive
while ! program args ... ; do
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple