The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
date command help bsandeep_80 UNIX for Advanced & Expert Users 4 04-30-2008 12:00 PM
Help with a Date Command !!! kumarsaravana_s UNIX for Dummies Questions & Answers 1 05-28-2007 12:33 PM
Date Command -1 greengrass UNIX for Dummies Questions & Answers 4 01-24-2007 02:18 PM
date command vshyam4949 UNIX for Dummies Questions & Answers 2 01-30-2006 07:40 AM
Date Command saldana UNIX for Dummies Questions & Answers 2 02-05-2004 07:50 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-09-2000
Registered User
 

Join Date: Oct 2000
Posts: 42
Ok,
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.

A
Forum Sponsor
  #2 (permalink)  
Old 11-09-2000
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,190
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]
  #3 (permalink)  
Old 11-09-2000
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 905
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:
Code:
FOO=`date +%H|cut -c1`

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

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.

HTH
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0