countdown/abnormal.sh
2025-04-15 15:32:22 +08:00

17 lines
285 B
Bash
Raw 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
# 计数从1开始到15结束
for i in {1..15}
do
# 计算还剩多少秒
remaining=$((15 - i + 1))
# 输出当前状态
echo "${i}秒,还有${remaining}秒崩溃..."
# 等待1秒
sleep 1
done
echo "计时结束,发生崩溃!"
exit 1