首先,修改~/.bashrc
vim ~/.bashrc加入:
repeat() {
n=$1
shift
while [ $(( n -= 1 )) -ge 0 ]
do
"$@"
done
}
讀bash環境設定
source ~/.bashrc如此一來就可以重複執行shell command了! 下列指令會重複執行3次
repeat 3 bonnie++ -u root -d /dev/hdaReference: Always Right
沒有留言:
張貼留言