#!/bin/bash while [ 1 ]; do make program if [ $? -eq 0 ]; then break; fi sleep 1 done