码迷,mamicode.com
首页 > 其他好文 > 详细

bash shell 数字时间钟表

时间:2014-07-03 14:05:03      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:shell   bash   数字时间   

在某行或者某个位置,打印出“YY/MM/DD HH:MM:SS”


先确定位置

再输出即可

注:有关时间格式到问题 %Y: %B: %d %H:%M:%S

       定位以及光标到问题:

        tput cup 10 10

        tput sc, tput rc, tput civis, tput cnorm

#!/bin/sh

tput civis
while true
do
        tput sc
        #tput clear
        tput cup 17 10
        echo -n $(date +%Y)/$(date +%B)/$(date +%d) $(date +%H):$(date +%M):$(date +%S)
        sleep 1
        tput rc
done


$bash test.sh &


bash shell 数字时间钟表,布布扣,bubuko.com

bash shell 数字时间钟表

标签:shell   bash   数字时间   

原文地址:http://5125854.blog.51cto.com/5115854/1433599

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!