From a8f2f86bc908138bac692fd6b3e6bb6e2b28ce5b Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Fri, 28 Mar 2014 10:55:32 -0700 Subject: [PATCH] add ttd: run a command until it fails. Signed-off-by: Colin McCabe --- ttd | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) create mode 100755 ttd diff --git a/ttd b/ttd new file mode 100755 index 0000000..b8ba46c --- /dev/null +++ b/ttd @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# +# ttd: run a command until it fails. +# +# usage: ttd [num-runs] command +# + +NUM_RUNS=$1 +shift +CMD="${@}" +for i in `seq 1 $NUM_RUNS`; do + ${CMD} + if [ $? -ne 0 ]; then + exit 1 + fi +done + +echo "*** SUCCESSFULLY RAN ${NUM_RUNS} RUNS ***" -- 1.6.6.rc1.39.g9a42