summaryrefslogtreecommitdiff
path: root/do-until
diff options
context:
space:
mode:
Diffstat (limited to 'do-until')
-rwxr-xr-xdo-until12
1 files changed, 12 insertions, 0 deletions
diff --git a/do-until b/do-until
new file mode 100755
index 0000000..d9dc863
--- /dev/null
+++ b/do-until
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# do-until - run a command until it succeeds
+#
+# Lars Wirzenius <liw@liw.fi>
+
+cmdline="$@"
+while ! $cmdline
+do
+ echo "Command failed, trying again in 1 second"
+ sleep 1
+done