#!/usr/bin/bash while true do t=`date` echo "$t " sleep 2 done
每2秒打印一下时间 while 循环命令格式 while testcommand do commands done