Skip to content

Instantly share code, notes, and snippets.

@joefiorini joefiorini/runwhile
Created Dec 2, 2016

Embed
What would you like to do?
#!/usr/bin/env fish
clear
set -l num_runs 0
while true;
echo "Executing: $argv"
eval "$argv"
set cmd_status $status
set num_runs (math "$num_runs+1")
if test $cmd_status -ne 0
echo ""
echo " ❎ failed after $num_runs tries"
echo ""
break
end
echo ""
echo " ✅ succeeded, retrying..."
echo ""
sleep 2
clear
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.