[Bash]在Shell/Bash中实现Pause的功能
2020-03-11 本文已影响0人
_小老虎_
- 可以用
read
read: usage: read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
-p
提示
function pause (){
read -p "prese -> continue"
}
- 使用方法 编写
test.sh
#!/bin/bash
function pause (){
read -p "prese -> continue"
}
echo 111
pause
222
运行
bash test.sh