#!/bin/bash
tput civis
while [ 1 ]
do
tput clear
tput cup 3 10
tput setb 0
tput setf 2
echo -e "\e[1;32m$(date "+%Y-%m-%d %H:%M:%S %A")\e[0m"
sleep 1
done
在Xshell中运行会有闪屏,不太正常;在本地运行一切正常
#!/bin/bash
watch -n 1 'date +"%F %A %T"'
通过这个简单命令实现,会显示多余的信息,不够完美
转载于:https://blog.51cto.com/hiyang/1792844