#!/bin/bash echo "天气预报服务启动中..." while true do # 模拟每10秒输出一次天气预报 echo "[天气预报] 当前时间: $(date '+%Y-%m-%d %H:%M:%S'),天气:晴朗,温度:25°C" sleep 10 done