#!/usr/bin/bash if [ $# -lt 1 ] then echo "Parameters missing." echo "Usage: $0 <executable name>" exit fi while : do $1 printf "$(date) : $1 return $?, wait for 5 seconds to restart\n" sleep 5 done