Compare dates using awk in bash
up vote
0
down vote
favorite
I have a file and each line has some info and a date,so what I want is to print the lines with dates after a given date. I use this awk command
sort -t$'|' -k5 $2 | awk -F '|' -v DatedAfter=$4 '!/^#/ && $5>=DatedAfter {print $0}'
Where $4 is a date in DD/MM/YYYY format given and $2 is the file I use in the format bellow.
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
So when i execute my code i get these results.
./tool.sh --born-since 17/11/1983 -f events.dat
1099511629352|Nunez|Jorge|female|17/11/1986|2011-04-04T05:54:52.693+0000|201.221.59.59|Opera|Facebook
1099511638548|Phan|Don|female|17/5/1981|2011-04-19T00:14:15.041+0000|112.72.79.36|Opera|Flickr
1099511638387|Znaimer|Moses|male|17/8/1980|2011-05-12T01:03:01.291+0000|94.199.19.90|Internet Explorer|Youtube
6597069776449|Svensson|Ernst|male|30/11/1981|2012-04-22T05:16:03.557+0000|31.31.166.207|Opera|Youtube
2199023258994|Ngoche|Alex Obanda|female|30/9/1987|2011-07-22T16:36:27.420+0000|41.81.41.21|Opera|Google+
7696581405294|Dobrunov|Aleksandr|male|31/12/1989|2012-05-15T05:46:31.439+0000|31.25.243.122|Internet Explorer|LinkedIn
2199023266450|Charoenpura|Somchai|male|4/12/1987|2011-08-30T20:34:41.524+0000|110.76.154.132|Mozilla|Youtube
3298534890514|Chen|Hsin|male|4/4/1988|2011-11-03T16:32:44.238+0000|115.42.116.30|Safari|Google+
2199023261081|Ben Dhifallah|Karim|male|6/4/1980|2011-06-11T02:24:17.194+0000|193.95.74.75|Chrome|Twitter
8796093024550|Yang|Lei|male|7/1/1990|2012-07-15T17:14:42.186+0000|1.4.92.176|Mozilla|Facebook
bash shell-script awk date
add a comment |
up vote
0
down vote
favorite
I have a file and each line has some info and a date,so what I want is to print the lines with dates after a given date. I use this awk command
sort -t$'|' -k5 $2 | awk -F '|' -v DatedAfter=$4 '!/^#/ && $5>=DatedAfter {print $0}'
Where $4 is a date in DD/MM/YYYY format given and $2 is the file I use in the format bellow.
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
So when i execute my code i get these results.
./tool.sh --born-since 17/11/1983 -f events.dat
1099511629352|Nunez|Jorge|female|17/11/1986|2011-04-04T05:54:52.693+0000|201.221.59.59|Opera|Facebook
1099511638548|Phan|Don|female|17/5/1981|2011-04-19T00:14:15.041+0000|112.72.79.36|Opera|Flickr
1099511638387|Znaimer|Moses|male|17/8/1980|2011-05-12T01:03:01.291+0000|94.199.19.90|Internet Explorer|Youtube
6597069776449|Svensson|Ernst|male|30/11/1981|2012-04-22T05:16:03.557+0000|31.31.166.207|Opera|Youtube
2199023258994|Ngoche|Alex Obanda|female|30/9/1987|2011-07-22T16:36:27.420+0000|41.81.41.21|Opera|Google+
7696581405294|Dobrunov|Aleksandr|male|31/12/1989|2012-05-15T05:46:31.439+0000|31.25.243.122|Internet Explorer|LinkedIn
2199023266450|Charoenpura|Somchai|male|4/12/1987|2011-08-30T20:34:41.524+0000|110.76.154.132|Mozilla|Youtube
3298534890514|Chen|Hsin|male|4/4/1988|2011-11-03T16:32:44.238+0000|115.42.116.30|Safari|Google+
2199023261081|Ben Dhifallah|Karim|male|6/4/1980|2011-06-11T02:24:17.194+0000|193.95.74.75|Chrome|Twitter
8796093024550|Yang|Lei|male|7/1/1990|2012-07-15T17:14:42.186+0000|1.4.92.176|Mozilla|Facebook
bash shell-script awk date
I assume (please confirm) that the first line of code in your question is part of a script which expects a filename as the 2nd parameter and a date (in the format of DD-MM-YYYY?) as the 4th parameter?
– Jeff Schaller
2 days ago
Not exactly, the command i use is like this ./exec.sh -f <file> --born-since <DD/MM/YYYY>.
– Μάριος Τσοκανάς
2 days ago
Please edit that incoming date format into the question, so answerers knows how to compare it. Thank you!
– Jeff Schaller
2 days ago
May I doubt that it works with the first date format either?
– RudiC
2 days ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a file and each line has some info and a date,so what I want is to print the lines with dates after a given date. I use this awk command
sort -t$'|' -k5 $2 | awk -F '|' -v DatedAfter=$4 '!/^#/ && $5>=DatedAfter {print $0}'
Where $4 is a date in DD/MM/YYYY format given and $2 is the file I use in the format bellow.
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
So when i execute my code i get these results.
./tool.sh --born-since 17/11/1983 -f events.dat
1099511629352|Nunez|Jorge|female|17/11/1986|2011-04-04T05:54:52.693+0000|201.221.59.59|Opera|Facebook
1099511638548|Phan|Don|female|17/5/1981|2011-04-19T00:14:15.041+0000|112.72.79.36|Opera|Flickr
1099511638387|Znaimer|Moses|male|17/8/1980|2011-05-12T01:03:01.291+0000|94.199.19.90|Internet Explorer|Youtube
6597069776449|Svensson|Ernst|male|30/11/1981|2012-04-22T05:16:03.557+0000|31.31.166.207|Opera|Youtube
2199023258994|Ngoche|Alex Obanda|female|30/9/1987|2011-07-22T16:36:27.420+0000|41.81.41.21|Opera|Google+
7696581405294|Dobrunov|Aleksandr|male|31/12/1989|2012-05-15T05:46:31.439+0000|31.25.243.122|Internet Explorer|LinkedIn
2199023266450|Charoenpura|Somchai|male|4/12/1987|2011-08-30T20:34:41.524+0000|110.76.154.132|Mozilla|Youtube
3298534890514|Chen|Hsin|male|4/4/1988|2011-11-03T16:32:44.238+0000|115.42.116.30|Safari|Google+
2199023261081|Ben Dhifallah|Karim|male|6/4/1980|2011-06-11T02:24:17.194+0000|193.95.74.75|Chrome|Twitter
8796093024550|Yang|Lei|male|7/1/1990|2012-07-15T17:14:42.186+0000|1.4.92.176|Mozilla|Facebook
bash shell-script awk date
I have a file and each line has some info and a date,so what I want is to print the lines with dates after a given date. I use this awk command
sort -t$'|' -k5 $2 | awk -F '|' -v DatedAfter=$4 '!/^#/ && $5>=DatedAfter {print $0}'
Where $4 is a date in DD/MM/YYYY format given and $2 is the file I use in the format bellow.
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
So when i execute my code i get these results.
./tool.sh --born-since 17/11/1983 -f events.dat
1099511629352|Nunez|Jorge|female|17/11/1986|2011-04-04T05:54:52.693+0000|201.221.59.59|Opera|Facebook
1099511638548|Phan|Don|female|17/5/1981|2011-04-19T00:14:15.041+0000|112.72.79.36|Opera|Flickr
1099511638387|Znaimer|Moses|male|17/8/1980|2011-05-12T01:03:01.291+0000|94.199.19.90|Internet Explorer|Youtube
6597069776449|Svensson|Ernst|male|30/11/1981|2012-04-22T05:16:03.557+0000|31.31.166.207|Opera|Youtube
2199023258994|Ngoche|Alex Obanda|female|30/9/1987|2011-07-22T16:36:27.420+0000|41.81.41.21|Opera|Google+
7696581405294|Dobrunov|Aleksandr|male|31/12/1989|2012-05-15T05:46:31.439+0000|31.25.243.122|Internet Explorer|LinkedIn
2199023266450|Charoenpura|Somchai|male|4/12/1987|2011-08-30T20:34:41.524+0000|110.76.154.132|Mozilla|Youtube
3298534890514|Chen|Hsin|male|4/4/1988|2011-11-03T16:32:44.238+0000|115.42.116.30|Safari|Google+
2199023261081|Ben Dhifallah|Karim|male|6/4/1980|2011-06-11T02:24:17.194+0000|193.95.74.75|Chrome|Twitter
8796093024550|Yang|Lei|male|7/1/1990|2012-07-15T17:14:42.186+0000|1.4.92.176|Mozilla|Facebook
bash shell-script awk date
bash shell-script awk date
edited 2 days ago
asked 2 days ago
Μάριος Τσοκανάς
256
256
I assume (please confirm) that the first line of code in your question is part of a script which expects a filename as the 2nd parameter and a date (in the format of DD-MM-YYYY?) as the 4th parameter?
– Jeff Schaller
2 days ago
Not exactly, the command i use is like this ./exec.sh -f <file> --born-since <DD/MM/YYYY>.
– Μάριος Τσοκανάς
2 days ago
Please edit that incoming date format into the question, so answerers knows how to compare it. Thank you!
– Jeff Schaller
2 days ago
May I doubt that it works with the first date format either?
– RudiC
2 days ago
add a comment |
I assume (please confirm) that the first line of code in your question is part of a script which expects a filename as the 2nd parameter and a date (in the format of DD-MM-YYYY?) as the 4th parameter?
– Jeff Schaller
2 days ago
Not exactly, the command i use is like this ./exec.sh -f <file> --born-since <DD/MM/YYYY>.
– Μάριος Τσοκανάς
2 days ago
Please edit that incoming date format into the question, so answerers knows how to compare it. Thank you!
– Jeff Schaller
2 days ago
May I doubt that it works with the first date format either?
– RudiC
2 days ago
I assume (please confirm) that the first line of code in your question is part of a script which expects a filename as the 2nd parameter and a date (in the format of DD-MM-YYYY?) as the 4th parameter?
– Jeff Schaller
2 days ago
I assume (please confirm) that the first line of code in your question is part of a script which expects a filename as the 2nd parameter and a date (in the format of DD-MM-YYYY?) as the 4th parameter?
– Jeff Schaller
2 days ago
Not exactly, the command i use is like this ./exec.sh -f <file> --born-since <DD/MM/YYYY>.
– Μάριος Τσοκανάς
2 days ago
Not exactly, the command i use is like this ./exec.sh -f <file> --born-since <DD/MM/YYYY>.
– Μάριος Τσοκανάς
2 days ago
Please edit that incoming date format into the question, so answerers knows how to compare it. Thank you!
– Jeff Schaller
2 days ago
Please edit that incoming date format into the question, so answerers knows how to compare it. Thank you!
– Jeff Schaller
2 days ago
May I doubt that it works with the first date format either?
– RudiC
2 days ago
May I doubt that it works with the first date format either?
– RudiC
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
It will be easier if the dates are in YYYYMMDD
(then they will be in lexicographic and numeric order). You can use gensub
for that in awk. For example:
awk -F"|" -v d="$d" -v dp='(..)/(..)/(....)' 'BEGIN {gensub(dp, "321", d)} {dt=$5; gensub(dp, "321", dt);} dt >= d' foo
The d
variable holds the date for comparison, and dp
holds the pattern matching a DD/MM/YYYY
date. Then with gensub
, we move around those (3
, 2
, 1
being the matched groups ((....)
, the second (..)
, the first (..)
, respectively). Same with the fifth field of each line, which we copy to avoid modifying the input.
I expanded your example input with some more dates:
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1977|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/03/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
And got this result using 19/04/1978
for comparison:
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
New contributor
add a comment |
up vote
1
down vote
How about
DT="01/08/1989"
awk -F| -vDT=${DT:6}${DT:3:2}${DT:0:2} 'substr($5, 7) substr($5, 4, 2) substr($5, 1, 2) > DT' file
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
It will be easier if the dates are in YYYYMMDD
(then they will be in lexicographic and numeric order). You can use gensub
for that in awk. For example:
awk -F"|" -v d="$d" -v dp='(..)/(..)/(....)' 'BEGIN {gensub(dp, "321", d)} {dt=$5; gensub(dp, "321", dt);} dt >= d' foo
The d
variable holds the date for comparison, and dp
holds the pattern matching a DD/MM/YYYY
date. Then with gensub
, we move around those (3
, 2
, 1
being the matched groups ((....)
, the second (..)
, the first (..)
, respectively). Same with the fifth field of each line, which we copy to avoid modifying the input.
I expanded your example input with some more dates:
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1977|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/03/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
And got this result using 19/04/1978
for comparison:
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
New contributor
add a comment |
up vote
3
down vote
accepted
It will be easier if the dates are in YYYYMMDD
(then they will be in lexicographic and numeric order). You can use gensub
for that in awk. For example:
awk -F"|" -v d="$d" -v dp='(..)/(..)/(....)' 'BEGIN {gensub(dp, "321", d)} {dt=$5; gensub(dp, "321", dt);} dt >= d' foo
The d
variable holds the date for comparison, and dp
holds the pattern matching a DD/MM/YYYY
date. Then with gensub
, we move around those (3
, 2
, 1
being the matched groups ((....)
, the second (..)
, the first (..)
, respectively). Same with the fifth field of each line, which we copy to avoid modifying the input.
I expanded your example input with some more dates:
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1977|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/03/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
And got this result using 19/04/1978
for comparison:
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
New contributor
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
It will be easier if the dates are in YYYYMMDD
(then they will be in lexicographic and numeric order). You can use gensub
for that in awk. For example:
awk -F"|" -v d="$d" -v dp='(..)/(..)/(....)' 'BEGIN {gensub(dp, "321", d)} {dt=$5; gensub(dp, "321", dt);} dt >= d' foo
The d
variable holds the date for comparison, and dp
holds the pattern matching a DD/MM/YYYY
date. Then with gensub
, we move around those (3
, 2
, 1
being the matched groups ((....)
, the second (..)
, the first (..)
, respectively). Same with the fifth field of each line, which we copy to avoid modifying the input.
I expanded your example input with some more dates:
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1977|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/03/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
And got this result using 19/04/1978
for comparison:
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
New contributor
It will be easier if the dates are in YYYYMMDD
(then they will be in lexicographic and numeric order). You can use gensub
for that in awk. For example:
awk -F"|" -v d="$d" -v dp='(..)/(..)/(....)' 'BEGIN {gensub(dp, "321", d)} {dt=$5; gensub(dp, "321", dt);} dt >= d' foo
The d
variable holds the date for comparison, and dp
holds the pattern matching a DD/MM/YYYY
date. Then with gensub
, we move around those (3
, 2
, 1
being the matched groups ((....)
, the second (..)
, the first (..)
, respectively). Same with the fifth field of each line, which we copy to avoid modifying the input.
I expanded your example input with some more dates:
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1977|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/03/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
And got this result using 19/04/1978
for comparison:
1099511633435|Smith|Jack|male|19/04/1978|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1979|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
1099511633435|Smith|Jack|male|19/04/1980|2010-05-26T03:45:11.772+0000|50.72.193.218|Internet Explorer
New contributor
New contributor
answered 2 days ago
Elayne
732
732
New contributor
New contributor
add a comment |
add a comment |
up vote
1
down vote
How about
DT="01/08/1989"
awk -F| -vDT=${DT:6}${DT:3:2}${DT:0:2} 'substr($5, 7) substr($5, 4, 2) substr($5, 1, 2) > DT' file
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
add a comment |
up vote
1
down vote
How about
DT="01/08/1989"
awk -F| -vDT=${DT:6}${DT:3:2}${DT:0:2} 'substr($5, 7) substr($5, 4, 2) substr($5, 1, 2) > DT' file
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
add a comment |
up vote
1
down vote
up vote
1
down vote
How about
DT="01/08/1989"
awk -F| -vDT=${DT:6}${DT:3:2}${DT:0:2} 'substr($5, 7) substr($5, 4, 2) substr($5, 1, 2) > DT' file
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
How about
DT="01/08/1989"
awk -F| -vDT=${DT:6}${DT:3:2}${DT:0:2} 'substr($5, 7) substr($5, 4, 2) substr($5, 1, 2) > DT' file
1099511628908|Chen|Wei|female|02/08/1989|2010-05-24T20:52:26.582+0000|27.98.244.108|Firefox
answered 2 days ago
RudiC
3,0811211
3,0811211
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482319%2fcompare-dates-using-awk-in-bash%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I assume (please confirm) that the first line of code in your question is part of a script which expects a filename as the 2nd parameter and a date (in the format of DD-MM-YYYY?) as the 4th parameter?
– Jeff Schaller
2 days ago
Not exactly, the command i use is like this ./exec.sh -f <file> --born-since <DD/MM/YYYY>.
– Μάριος Τσοκανάς
2 days ago
Please edit that incoming date format into the question, so answerers knows how to compare it. Thank you!
– Jeff Schaller
2 days ago
May I doubt that it works with the first date format either?
– RudiC
2 days ago