Monday, 16 March 2020

Digital clock using watch, echo, banner and tput

Digital Clock

watch

#!/bin/bash
watch -tn 1 date +%T

echo

#!/bin/bash
clear
while [ 1 ] ; do echo -e "$(date +%T)" ; sleep 1; done

banner

#!/bin/bash
clear
while [ 1 ] ; do banner "$(date +%r)" ; sleep 1; clear ; done

while

#!/bin/bash
clear
while :
do
 echo -e "\033[92m $(date '+%r')"
 sleep 1
 clear
done

tput

#!/bin/bash
while sleep 1;do tput sc;tput cup $(($(tput lines)-1)) 1;printf `date +%r`;tput rc;done

#!/bin/bash
clear
while :
do
 ti= date '+%r'
 echo -e -n "\033[7s"
 tput cup 0 69
 echo -n $ti
 echo -e -n "\033[8u"
 sleep 1
 clear
done

Ref:- Google

No comments:

Post a comment