Hi,
Anyone ever write a unix clock program that display the clock out in 7 segment LCD style.
I tried doing one with case statements:
!/usr/bin/ksh
clock=`date`
case $clock in #This prints out the number 0
0)
echo " -"
echo "| |"
echo
echo "| |"
echo " -"
;;
#This prints out the number 1
1)
echo
echo "|"
echo
echo "|"
echo
Etc, to the rest of the number 2-9.
But I want the clock to print out line by not number by number.(5 lines) All with "-" and "|".
Including military format, hours, minutes, seconds.
So I thought of doing some sort of for loop which would have to execute 6 times(2 for every set - hours,minutes,seconds)
I am really confused.
What I am trying to do is print out my time(date) line by line so if the time was 09 23 21
it would come out like(that's the first 2 lines) just to give you an idea.
-
| | | | | | | |
I've tried using a for loop that excutes 6 times one for every number, then have another for loop that executes 5 times for the number of lines, then have case statements that echo the "-" or the "|" but I can't seem to get it going. I tried using 10 case statements 0-9 but I ain't getting anywhere.
Thanks again,
but I need something hand coded and strictly in unix(bash)
scripting.
I am looking at this as an example but I'm getting the same
as I already have.