Sponsored Content
Full Discussion: subtraction from date
Top Forums UNIX for Dummies Questions & Answers subtraction from date Post 302122231 by MarGur on Tuesday 19th of June 2007 05:51:42 PM
Old 06-19-2007
still fighting. I'll really appreciate any help.
thank you,
M.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Date Subtraction in KSH

I need to figure out the numeric representation of the previous month (in an automated monthly-running script) so that I may append it to a filename. I have tried statements such as variable=`date +%m -1` (and several variations) but with no success. I have also tried simply assigning the value... (3 Replies)
Discussion started by: mharley
3 Replies

2. Linux

date subtraction(URGENT)

Hi all, I need the date subtraction fuctionality using shell commands. For example: date1:Wed Apr 5 08:35:21 IST 2006 date2:Tue Apr 4 10:35:44 IST 2006 I need the date subtraction result like " 22 hours 23 seconds". Please guide me to complete this task. Can you please help me ASAP. ... (3 Replies)
Discussion started by: uday123
3 Replies

3. Shell Programming and Scripting

awk subtraction

hi i have file 1 as follows: 6 7 8 9 10 i have file 2 as follows: 5 5 5 5 5 i want file 3 as follows: (4 Replies)
Discussion started by: npatwardhan
4 Replies

4. Shell Programming and Scripting

Date subtraction

hi, i set up a script on my server to do a particular task once files from an external system are ftpd in the format compaq_20100110 (YYDDMM). Interestingly, the source of ftp is sending the files in the format e.g 20100109 i.e. previous date and for some reason this fails.kindly see my script... (2 Replies)
Discussion started by: bigtejus
2 Replies

5. Shell Programming and Scripting

use of uninitialized value in subtraction

Hallo all i am trying to execute this script ............... But this is throwing the error...... use of uninitialized value in subtraction in at icd_convert.pl line 156 use of uninitialized value in subtraction in at icd_convert.pl line 157 use of uninitialized value in subtraction in at... (1 Reply)
Discussion started by: suvenduperl
1 Replies

6. Shell Programming and Scripting

Date Subtraction with time.

HI gurus... I have a PERL file that help me extract the date and time of the file. The format of this is: yyyymmddhhmmss. Example: 20100430070935 (April 30 2010 07:09:35) How can i subtract the acquired time from system's time..?? The answer... (6 Replies)
Discussion started by: bankimmehta
6 Replies

7. Shell Programming and Scripting

Subtraction

Hi #!/bin/sh month=`date +%m` year=`date +%Y` echo $month a=02 # Retaining Data for Current and Previous Month lmonth=`expr $month - $a` if test "$lmonth" = "0" then lmonth=12 year=`expr $year - 1` fi echo $year echo $lmonth The output is (3 Replies)
Discussion started by: Abhayman
3 Replies

8. Shell Programming and Scripting

Subtraction using arrays

Hello all . I have two arrays. ${ARRAY_MOUNT_POINT_CAPACITY} ${ARRAY_MOUNT_POINT_CAPACITY}. Whats the synatx of subtracting their values , placing them in variable V1 and then echoeing it ??? Ive tried expr and let ...gives me ./test_code.sh: difference: bad number (3 Replies)
Discussion started by: Junaid Subhani
3 Replies

9. Shell Programming and Scripting

Need Help on date subtraction

I have dates as follows in a file 20121029135649 20121029135721 20121030091540 20121030093420 20121030094340 20121030095427 20121030095856 20121030100104 20121030100251 All these dates are in sorted order. I need to find out the difference between the dates as follows 2nd row... (6 Replies)
Discussion started by: meetsriharsha
6 Replies

10. UNIX for Dummies Questions & Answers

Date Subtraction

Hello All, I am a newbie to unix shell scripting and need to write a script that displays the difference between two variables that stores date value. For example, F1=`ls -ltr file1* | tail -1 |tr -s ' ' |cut -d' ' -f6,7,8` F2=`ls -ltr file2* | tail -1 |tr -s ' ' |cut -d' ' -f6,7,8` F1... (3 Replies)
Discussion started by: priyaa2010
3 Replies
appender_type_stream2.h(3)					       log4c						appender_type_stream2.h(3)

NAME
appender_type_stream2.h - Log4c stream2 appender interface. SYNOPSIS
#include <log4c/defs.h> #include <log4c/appender.h> Functions LOG4C_API void log4c_stream2_set_fp (log4c_appender_t *a_this, FILE *fp) LOG4C_API FILE * log4c_stream2_get_fp (log4c_appender_t *a_this) LOG4C_API void log4c_stream2_set_flags (log4c_appender_t *a_this, int flags) LOG4C_API int log4c_stream2_get_flags (log4c_appender_t *a_this) Variables __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_stream2 Detailed Description Log4c stream2 appender interface. The stream2 appender uses a file handle FILE* for logging. It can be used with stdout, stderr or a normal file. It is pretty primitive as it does not do file rotation, or have a maximum configurable file size etc. It improves on the stream appender in a few ways that make it a better starting point for new stream based appenders. It enhances the stream appender by allowing the default file pointer to be used in buffered or unbuffered mode. Also when you set the file pointer stream2 will not attempt to close it on exit which avoids it fighting with the owner of the file pointer. stream2 is configured via setter functions--the udata is not exposed directly. This means that new options (eg. configure the open mode ) could be added to stream2 while maintaining backward compatability. The appender can be used with default values, for example as follows: log4c_appender_t* myappender; myappender = log4c_appender_get('/var/logs/mylog.log'); log4c_appender_set_type(myappender,log4c_appender_type_get('stream2')); In this case the appender will be configured automatically with default values: o the filename is the same as the name of the appender, '/var/logs/mymlog.log' o the file is opened in 'w+' mode o the default system buffer is used (cf; setbuf() ) in buffered mode The stream2 appender can be configured by passing it a file pointer to use. In this case you manage the file pointer yourself--open, option setting, closing. If you set the file pointer log4c will not close the file on exiting--you must do this: log4c_appender_t* myappender; FILE * fp = fopen('myfile.log', 'w'); myappender = log4c_appender_get('myappender'); log4c_appender_set_type(myappender, log4c_appender_type_get('stream2')); log4c_stream2_set_fp(stream2_appender,myfp); The default file pointer can be configured to use unbuffered mode. Buffered mode is typically 25%-50% faster than unbuffered mode but unbuffered mode is useful if your preference is for a more synchronized log file: log4c_appender_t* myappender; myappender = log4c_appender_get('/var/logs/mylog.log'); log4c_appender_set_type(myappender,log4c_appender_type_get('stream2')); log4c_stream2_set_flags(myappender, LOG4C_STREAM2_UNBUFFERED); Function Documentation LOG4C_API int log4c_stream2_get_flags (log4c_appender_t *a_this) Get the flags for this appender. Parameters: this a pointer to the appender Returns: the flags for this appender. returns -1 if there was a problem. LOG4C_API FILE* log4c_stream2_get_fp (log4c_appender_t *a_this) Get the file pointer for this appender. Parameters: this a pointer to the appender Returns: the file pointer for this appender. If there's a problem returns NULL. LOG4C_API void log4c_stream2_set_flags (log4c_appender_t *a_this, intflags) Set the flags for this appender. Parameters: this a pointer to the appender flags ar teh flags to set. These will overwrite the existing flags. Currently supported flags: LOG4C_STREAM2_UNBUFFERED LOG4C_API void log4c_stream2_set_fp (log4c_appender_t *a_this, FILE *fp) Set the file pointer for this appender. Parameters: this a pointer to the appender fp the file pointer this appender will use. The caller is responsible for managing the file pointer (open, option setting, closing). Variable Documentation __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_stream2 Stream2 appender type definition. This should be used as a parameter to the log4c_appender_set_type() routine to set the type of the appender. Author Generated automatically by Doxygen for log4c from the source code. Version 1.2.1 Mon May 2 2011 appender_type_stream2.h(3)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy