#!/bin/bash echo "新闻播报服务启动中..." while true do # 获取当前时间 current_time=$(date '+%Y-%m-%d %H:%M:%S') # 构建JSON格式的日志 json_log=$(cat << EOF { "service": "新闻播报", "timestamp": "$current_time", "headline": "今日科技新闻,新型AI技术发布!" } EOF ) # 输出JSON格式的日志 echo "$json_log" sleep 5 done