1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh while getopts t: opt; do case $opt in t) time="$OPTARG";; \?) exit 1;; esac done shift $((OPTIND-1)) while :; do # suggested by https://github.com/koalaman/shellcheck/wiki/SC2294 "$@" sleep "${time:-1}" done