date command

I figured out how to code my LCD clock program the only problem I am now having is - making it print out.

I have my for loops and case statements in my program and after that I need to print out the time I know how to use the date with the cut command. But I am unsure on how to link my statements so that the time is printed out, after the case statements.


If I was going to print your project, I would write the output of your script to a file instead of the console (screen) and just print the file. For example, if your script is called sh_foo, just do an sh_foo > file.txt Then just print file.txt. Is there any reason you can't do this?

[Edited by Neo on 11-09-2000 at 11:51 PM]

Are you talking about printing it to the screen, or printing out a hard copy?

If you mean to the screen, then you might have something like:

FOO=`date +%H|cut -c1`

case $FOO in 
          2) echo "<some text>"
          3) echo "<some text>"

I dont know how your program is set up, but it sounds like you are using case statements. You would put the output (echo) in the appropriate portion of the case.
Read the bash or ksh man page for information on how to use the case statement.

I would recommend that you pick up a good Unix book that includes a section on shell scripting. Several have been recommended in different threads recently on this board.