linux 命令和教程补充

This commit is contained in:
estomm
2021-12-24 11:16:28 +08:00
parent 40e916976b
commit b7c3653392
586 changed files with 46455 additions and 39 deletions

39
Linux/command/sleep.md Normal file
View File

@@ -0,0 +1,39 @@
sleep
===
将目前动作延迟一段时间
## 补充说明
**sleep命令** 暂停指定的时间。
### 语法
```shell
sleep(参数)
```
### 参数
时间:指定要暂停时间的长度。
时间长度,后面可接 s、m、h 或 d其中 s 为秒m 为 分钟h 为小时d 为日数。
### 实例
有时在写一些以循环方式运行的监控脚本设置时间间隔是必不可少的下面是一个Shell进度条的脚本演示在脚本中生成延时。
```shell
#!/bin/bash
b=''
for ((i=0;$i<=100;i++))
do
printf "Progress:[%-100s]%d%%\r" $b $i
sleep 0.1
b=#$b
done
echo
```