wonderbeyond
9/10/2015 - 2:11 AM

continually run a command

continually run a command

#!/bin/bash
# Author: Wonder<wonderbeyond@gmail.com>
# Description: continually run a command, re-run after crashed
# Note: Please double press `CTRL-C` to stop the loop
until $@; do
    echo -e "\n'$@' stopped"
    sleep 0.2
    echo -e "\n'$@' re-run"
done