GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DGREP (1)

NAME

dgrep - Find date or time matches in input stream

CONTENTS

Synopsis
Description
Examples
Author

SYNOPSIS

dgrep [OPTION]... EXPRESSION

DESCRIPTION

dgrep 0.2.7

Grep standard input for lines that match EXPRESSION.

EXPRESSION may be date/times prefixed with an operator ‘<’, ‘<=’, ’=’, ’>=’, ’>’, ‘!=’, ‘<>’ (if omitted defaults to ‘=’), which will match lines with date/times which are older, older-equal, equal, newer-equal, newer, or not equal respectively.

EXPRESSION may also be format specifiers infixed by above operators and suffixed by a value (e.g. ‘%a="Wed"’) which matches lines whose %a representation (weekday name abbreviated) is "Wed".

EXPRESSION may be statements as described above concatenated through ‘&&’ (for conjunction) or ‘||’ (disjunction), both of which may be parenthesised as per usual to change precedence (‘&&’ goes over ‘||’).

If multiple date/times occur on the same line and any one of them fulfills the criteria then the line is considered a match and will be output.
-h, --help Print help and exit
-V, --version
  Print version and exit
-q, --quiet
  Suppress message about date/time and duration parser errors.
-i, --input-format=STRING
  Input format, can be used multiple times. Each date/time will be passed to the input format parsers in the order they are given, if a date/time can be read successfully with a given input format specifier string, that value will be used.
-e, --backslash-escapes
  Enable interpretation of backslash escapes in the output and input format specifier strings.
-o, --only-matching
  Show only the part of a line matching DATE.
-v, --invert-match
  Select non-matching lines.
Group: op
Operations can be specified by options as well. EXPRESSION must then be a date/time and no concatenation through conjunction (‘&&’) or disjunction (‘||’) operators is possible.
This serves solely as a means of convenience, e.g. the dtest tool has a similar syntax.
--eq Lines match when date/times are equal to EXPRESSION.
--ne Lines match when date/times are not the same as EXPRESSION.
--gt Lines match when date/times are newer than EXPRESSION.
--lt Lines match when date/times are older than EXPRESSION.
--ge Lines match when date/times are newer than or equal EXPRESSION.
--le Lines match when date/times are older than or equal EXPRESSION.
--nt Lines match when date/times are newer than or equal EXPRESSION.
--ot Lines match when date/times are older than or equal EXPRESSION.

EXAMPLES

$ dgrep 2012-03-01 <<EOF
2012-02-28
2012-02-29
2012-03-01
2012-03-02
EOF
2012-03-01
$

$ dgrep ’<2012-03-01’ <<EOF
2012-02-28
2012-02-29
2012-03-01
2012-03-02
EOF
2012-02-28
2012-02-29
$

$ dgrep \!=2012-03-01 <<EOF
2012-02-28
2012-02-29
2012-03-01
2012-03-02
EOF
2012-02-28
2012-02-29
2012-03-02
$

$ dgrep =2012-03-01 <<EOF
Feb   2012-02-28
Feb   2012-02-29      leap day
Mar   2012-03-01
Mar   2012-03-02
EOF
Mar   2012-03-01
$

$ dgrep -o lt;2012-03-01 <<EOF
Feb   2012-02-28
Feb   2012-02-29      leap day
Mar   2012-03-01
Mar   2012-03-02
EOF
2012-02-28
2012-02-29
$

$ dgrep ’>=12:00:00’ <<EOF
fileA 11:59:58
fileB 11:59:59        leap second?
fileNOON      12:00:00        new version
fileC 12:03:12
EOF
fileNOON      12:00:00        new version
fileC 12:03:12
$

$ dgrep -o ’>=12:00:00’ <<EOF
fileA 11:59:58
fileB 11:59:59        leap second?
fileNOON      12:00:00        new version
fileC 12:03:12
EOF
12:00:00
12:03:12
$

$ dgrep 2012-03-01 <<EOF
2012-02-28T10:00:00
2012-02-29T10:00:00
2012-03-01T10:00:00
2012-03-02T10:00:00
EOF
2012-03-01T10:00:00
$

$ dgrep ’<2012-03-01’ <<EOF
2012-02-28T10:00:00
2012-02-29T10:00:00
2012-03-01T10:00:00
2012-03-02T10:00:00
EOF
2012-02-28T10:00:00
2012-02-29T10:00:00
$

$ dgrep 2012-03-01T10:00:00 <<EOF
2012-02-28T10:00:00
2012-02-29T10:00:00
2012-03-01T10:00:00
2012-03-02T10:00:00
EOF
2012-03-01T10:00:00
$

$ dgrep ’<2012-03-01T14:00:00’ <<EOF
2012-02-28T10:00:00
2012-02-29T10:00:00
2012-03-01T10:00:00
2012-03-02T10:00:00
EOF
2012-02-28T10:00:00
2012-02-29T10:00:00
2012-03-01T10:00:00
$

AUTHOR

Written by Sebastian Freundt <freundt@fresse.org>

REPORTING BUGS

Report bugs to: https://github.com/hroptatyr/dateutils/issues

SEE ALSO

The full documentation for dgrep is maintained as a Texinfo manual. If the info and dgrep programs are properly installed at your site, the command
info (dateutils)dgrep
should give you access to the complete manual.
Search for    or go to Top of page |  Section 1 |  Main Index


dateutils 0.2.7 DGREP (1) January 2014

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.