shell脚本实现动态时钟

时间:2016-06-25 15:14:18   收藏:0   阅读:944
  1. #!/bin/bash
  2. tput civis
  3. while [ 1 ]
  4. do
  5.    tput clear
  6.    tput cup 3 10
  7.    tput setb 0
  8.    tput setf 2
  9.    echo -e "\e[1;32m$(date "+%Y-%m-%d %H:%M:%%A")\e[0m"
  10.    sleep 1
  11. done
在Xshell中运行会有闪屏,不太正常;在本地运行一切正常


来自为知笔记(Wiz)


评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!