You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
510 B

5 years ago
# **sleep**
7 years ago
6 years ago
## 说明
7 years ago
5 years ago
**sleep命令** 暂停指定的时间
7 years ago
5 years ago
## 选项
7 years ago
5 years ago
```markdown
5 years ago
时间长度,后面可接 s、m、h 或 d其中 s 为秒m 为 分钟h 为小时d 为日数
5 years ago
```
7 years ago
5 years ago
## 实例
7 years ago
5 years ago
```bash
# 有时在写一些以循环方式运行的监控脚本设置时间间隔是必不可少的下面是一个Shell进度条的脚本演示在脚本中生成延时
7 years ago
#!/bin/bash
b=''
for ((i=0;$i<=100;i++))
5 years ago
do
printf "Progress:[%-100s]%d%%\r" $b $i
sleep 0.1
b==#$b
done
7 years ago
```