[root@shaofeng ~]# ./repeat.sh repeat [root@shaofeng ~]# cat ./repeat.sh #!/bin/bash repeat() { while true; do $@ && return;done } case $1 in repeat) repeat;; *)echo "Usage: $(basename $0) repeat";; esac