Sponsored Content
Top Forums Shell Programming and Scripting Getting previous hour in formatted form Post 302510986 by ctsgnb on Tuesday 5th of April 2011 12:18:39 PM
Old 04-05-2011
which OS are you running ?

You would need to convert start date into seconds from 1970, and add to it the duration (converted in seconds)
(could be achieved using GNU date or using printf in ksh93, or maybe also using the Perderabo script , also read this thread)
You have then the ending date in second that you can convert back to a date so you can then scan the logfile and start printing lines as soon as first date has been reached and stop to print as soon as ending date has been reached.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Changing Unix form to Microsoft Word form to be able to email it to someone.

Please someone I need information on how to change a Unix form/document into a microsoft word document in order to be emailed to another company. Please help ASAP. Thankyou :confused: (8 Replies)
Discussion started by: Cheraunm
8 Replies

2. UNIX for Dummies Questions & Answers

an hour less in 24 hour system

My program: __________________________________ #!/bin/ksh DAY=`date +%y%m%d` H=`date +%H` M=`date +%M` day=`date +%m/%d/%y` let h=$H-1 echo DAY $DAY echo H $H echo M $M echo day $day echo h $h _____________________________________ My result: (3 Replies)
Discussion started by: bobo
3 Replies

3. Shell Programming and Scripting

Formatted Output

Hi I have the following lines in a file SWPRC000001NOT STATED 1344 SWPRC000001NOT STATED 1362 SWPRC000001NOT STATED 1418 SWPRC000001NOT STATED 1436 SWPRC000001NOT STATED ... (6 Replies)
Discussion started by: dhanamurthy
6 Replies

4. Shell Programming and Scripting

More formatted string

In a large file i need last line of the file but I want ignore first charcter, ignore leading zeros after first character and print the remaining character as such. Is something i can do it by tail or wc? cat test1 .... ...... 8000003687 cat test2 .... ...... 8000538990 o/p 3687 538990 (3 Replies)
Discussion started by: ford2020
3 Replies

5. Shell Programming and Scripting

Show previous hour

date +%Y%m%d%H output : 2011031415 I want to get previous hour like this 2011031414. Any one can help ? (15 Replies)
Discussion started by: alvin0618
15 Replies

6. Shell Programming and Scripting

Transpose Data form Different form

HI Guys, I have data in File A.txt RL03 RL03_A_1 RL03_B_1 RL03_C_1 RL03 -119.8 -119.5 -119.5 RL07 RL07_A_1 RL07_B_1 RL07_C_1 RL07 -119.3 -119.5 -119.5 RL15 RL15_A_1 RL15_C_1 RL15 -120.5 -119.4 RL16... (2 Replies)
Discussion started by: asavaliya
2 Replies

7. Shell Programming and Scripting

Remove x lines form top and y lines form bottom using AWK?

How to remove x lines form top and y lines form bottom. This works, but like awk only cat file | head -n-y | awk 'NR>(x-1)' so remove last 3 lines and 5 firstcat file | head -n-3 | awk 'NR>4' (5 Replies)
Discussion started by: Jotne
5 Replies

8. Shell Programming and Scripting

Remove previous line if next & previous lines have same 4th character.

I want to remove commands having no output. In below text file. bash-3.2$ cat abc_do_it.txt grpg10so>show trunk group all status grpg11so>show trunk group all status grpg12so>show trunk group all status GCPKNYAIGT73IMO 1440 1345 0 0 94 0 0 INSERVICE 93% 0%... (4 Replies)
Discussion started by: Raza Ali
4 Replies

9. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies
LIBEXSLT(3)						     Library Functions Manual						       LIBEXSLT(3)

NAME
libexslt - extension library for XSLT SYNOPSIS
#include <libexslt/exslt.h> void exsltCommonRegister(void); void exsltDateRegister(void); void exsltDynRegister(void); void exsltFuncRegister(void); void exsltMathRegister(void); void exsltSetsRegister(void); void exsltStrRegister(void); void exsltRegisterAll(void); void exsltSaxonRegister(void); DESCRIPTION
The libexslt library is used to provide extensions to XSLT functions. These extensions come from the EXSLT project <http://www.exslt.org/> USAGE
To make use of these functions in XSLT the appropriate namespace must be defined on the xsl:stylesheet element. To enable support for them in libxslt(3) you must call the appropriate functions (listed in the SYNOPSIS section) to register the extensions. The xslt-config shell script can be used to obtain the necessary flags for the pre-processor and linker. The supported extensions are: COMMON Namespace: http://exslt.org/common See http://www.exslt.org/exsl/index.html for a description. node-set() convert the given RTF into a node-set. object-type() returns the type of the given argument. document Create multiple output documents. See http://www.exslt.org/exsl/elements/document/index.html MATH Namespace: http://exslt.org/math See http://www.exslt.org/math/index.html for a description. min() returns the minimum value of the given node-set max() returns the maximum value of the given node-set highest() returns the nodes in the node-set whose value is the maximum value for the node-set. lowest() returns the nodes in the node-set whose value is the minimum value for the node-set. constant() returns a number value of the given constant with the given precision. The constants are PI, E, SQRRT2, LN2, LN10, LOG2E, and SQRT1_2. random() returns a random number between 0 and 1 inclusive. abs() returns the absolute value of the argument. sqrt() returns the square root of the argument. power() returns the power base and power arguments. log() returns the natural log of the argument. sin() returns the sine of the argument. cos() returns the cosine of the argument. tan() returns the tangent of the argument. asin() returns the arc sine of the argument. acos() returns the arc cosine of the argument. atan() returns the arc tangent of the argument. atan2() returns the arc tangent function of the y/x arguments. exp() returns the exponential function of the argument. SETS Namespace: http://exslt.org/sets See http://www.exslt.org/set/index.html for a description. difference() returns the difference between the two given node-sets. intersection() returns a node-set of the nodes within both given node-sets. distinct() returns a node-set of all nodes in the first argument that are not in the seconds argument. has-same-node() returns TRUE if there is an intersection between the two given node-sets. leading() returns a node-set of all nodes in the first argument that precede the first node in the second argument. trailing() returns a node-set of all nodes in the first argument that follow the first node in the second argument. DATES and TIMES Namespace: http://exslt.org/dates-and-times See http://www.exslt.org/date/date.html for a description. date-time() returns the current date and time as a date/time string. date() returns the date specified in the given date/time string. time() returns the time specified in the date/time string given as the argument. year() returns the year of a date as a number. leap-year() returns true if the year given in a date is a leap year. month-in-year() returns the month of a date as a number. month-name() returns the full name of the month of a date. month-abbreviation() returns the abbreviation of the month of a date. week-in-year() returns the week of the year as a number. week-in-month() returns the week in a month of a date as a number. day-in-year() returns the month of a date as a number. day-in-month() returns the day of a date as a number. day-of-week-in-month() returns the day-of-the-week in a month of a date as a number. day-in-week() returns the day of the week given in a date as a number. day-name() returns the full name of the day of the week of a date. day-abbreviation() returns the abbreviation of the day of the week of a date. hour-in-day() returns the hour of the day as a number. minute-in-hour() returns the minute of the hour as a number. second-in-minute() returns the second of the minute as a number. seconds() returns the number of seconds specified by the argument string. add() returns the date/time resulting from adding a duration to a date/time. add-duration() returns the duration resulting from adding two given durations together. difference() returns the duration between the first date and the second date. duration() returns a duration string that represents the given number of seconds since 1970-01-01T00:00:00. STRINGS Namespace: http://exslt.org/strings See http://www.exslt.org/str/index.html for a description. tokenize() returns a node set of token elements, each containing one token from the string. padding() returns a string padded to a certain length. align() returns a string aligned within another string. concat() returns the concatenation of the string values of the nodes in that node set. FUNCTIONS Namespace: http://exslt.org/functions See http://www.exslt.org/func/index.html for a description. function declares an extension function. result returns the result of an extension function declared in function(). FILES
/usr/bin/xslt-config shell script giving pre-processor and linker flags. /usr/lib/libexslt.a static library /usr/lib/libexslt.so sharable library AUTHORS
Manual page by Heiko W. Rupp (hwr@pilhuhn.de) SEE ALSO
libxml(3), libxslt(3), xmllint(1) xsltproc(1), libxslt 04 November 2003 LIBEXSLT(3)
All times are GMT -4. The time now is 08:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy