实战演练

  • 定义函数
[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

results matching ""

    No results matching ""