Sponsored Content
Full Discussion: date command
Top Forums UNIX for Dummies Questions & Answers date command Post 219 by PxT on Thursday 9th of November 2000 11:59:50 PM
Old 11-10-2000
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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

date command

Using the date command how do get yesterday's date?? e.g. date '+%b%e%Y' July 30 2002 I need to get July 29 2002 using the date command. Thanx (p.s. sorry if it's a very obvious question) (6 Replies)
Discussion started by: niamo1
6 Replies

2. UNIX for Dummies Questions & Answers

Date Command

we're using HP-UX I need to change the year. What is the date command? Thanks (2 Replies)
Discussion started by: saldana
2 Replies

3. Shell Programming and Scripting

want to get previous date from date command in ksh

I want to get previous date from date command. I am using ksh shell. Exmp: today is 2008.09.04 I want the result : 2008.09.03 Please help. Thanks in advance. (4 Replies)
Discussion started by: rinku
4 Replies

4. UNIX for Dummies Questions & Answers

date command

Hi All. I'm using date -a to 'drift' the time forward / backwards. The question is - how do I know when its finished 'drifting' ? On some systems I have another time reference I can use but not always. thanks (1 Reply)
Discussion started by: Mudshark
1 Replies

5. Shell Programming and Scripting

date command

Hi is it possible to give the date command like 24th July 2009 ive tried DATE=`date "+%d%m%Y" echo $DATE that only replies 2009 correctly. not sure how to display the month in full or if unix knows how to do i.e 2nd, 24th, 3rd (1 Reply)
Discussion started by: magnia
1 Replies

6. Shell Programming and Scripting

how to obtain date and day of the week from `date` command

Hi, does anybody know how to format `date` command correctly to return the day of the week? Thanks -A I work in ksh.... (1 Reply)
Discussion started by: aoussenko
1 Replies

7. Shell Programming and Scripting

How to get tomorrow,yesterday date from date Command

Hi I want to get tomorrow and yesterday date from date command. My shell is KSH and server is AIX. I tried several options, but unable to do. Please help on this. Regards Rajesh (5 Replies)
Discussion started by: rajeshmepco
5 Replies

8. Shell Programming and Scripting

Find week of the year for given date using date command inside awk

Hi all, Need an urgent help on the below scenario. script: awk -F"," 'BEGIN { #some variable assignment} { #some calculation and put values in array} END { year=#getting it from array and assume this will be 2014 month=#getting it from array and this will be 05 date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies

9. HP-UX

HP/UX command to pull file name/date based on date

HI, Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Discussion started by: lnemitz
2 Replies

10. HP-UX

awk command in hp UNIX subtract 30 days automatically from current date without date illegal option

current date command runs well awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat subtract 30 days fails awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
OCI_FIELD_SIZE(3)														 OCI_FIELD_SIZE(3)

oci_field_size - Returns field's size

SYNOPSIS
int oci_field_size (resource $statement, mixed $field) DESCRIPTION
Returns the size of a $field. PARAMETERS
o $statement - A valid OCI statement identifier. o $field - Can be the field's index (1-based) or name. RETURN VALUES
Returns the size of a $field in bytes, or FALSE on errors. EXAMPLES
Example #1 oci_field_size(3) example <?php // Create the table with: // CREATE TABLE mytab (number_col NUMBER, varchar2_col varchar2(1), // clob_col CLOB, date_col DATE); $conn = oci_connect("hr", "hrpwd", "localhost/XE"); if (!$conn) { $m = oci_error(); trigger_error(htmlentities($m['message']), E_USER_ERROR); } $stid = oci_parse($conn, "SELECT * FROM mytab"); oci_execute($stid, OCI_DESCRIBE_ONLY); // Use OCI_DESCRIBE_ONLY if not fetching rows echo "<table border="1"> "; echo "<tr>"; echo "<th>Name</th>"; echo "<th>Type</th>"; echo "<th>Length</th>"; echo "</tr> "; $ncols = oci_num_fields($stid); for ($i = 1; $i <= $ncols; $i++) { $column_name = oci_field_name($stid, $i); $column_type = oci_field_type($stid, $i); $column_size = oci_field_size($stid, $i); echo "<tr>"; echo "<td>$column_name</td>"; echo "<td>$column_type</td>"; echo "<td>$column_size</td>"; echo "</tr> "; } echo "</table> "; // Outputs: // Name Type Length // NUMBER_COL NUMBER 22 // VARCHAR2_COL VARCHAR2 1 // CLOB_COL CLOB 4000 // DATE_COL DATE 7 oci_free_statement($stid); oci_close($conn); ?> NOTES
Note In PHP versions before 5.0.0 you must use ocicolumnsize(3) instead. This name still can be used, it was left as alias of oci_field_size(3) for downwards compatability. This, however, is deprecated and not recommended. SEE ALSO
oci_num_fields(3), oci_field_name(3). PHP Documentation Group OCI_FIELD_SIZE(3)
All times are GMT -4. The time now is 07:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy