shell-scripts/tutorials/basic/15-while-loop.sh

11 lines
250 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
#Program:
# 判断输入如果用户输入yes就继续执行否则结束运行
#History:
# 2024/07/14 LouisFonda<yigencong@yahoo.com>
yn="yes"
while [ "${yn}" == "yes" -o "${yn}" == "YES" ]
do
read -p "是否继续运行" yn
done