http://www.perlmonks.org?node_id=985645


in reply to Re: grep lines from log for last 10 mints
in thread grep lines from log for last 10 mints

So something resembling this

#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; my $command = q{awk} .q{ -v start="$(date -d '10 mins ago' +'%b %e %T')"} .q{ -v end="$(date +'%b %e %T')"} .q{ '} #### ???? .q{ {tm=$1" "$2" "$3}} .q{ ; } .q{ start<tm } .q{ && } .q{ tm<end} .q{ '} .q{ /d/d1/logs/stdout-1132.txt}; dd $command; my $line = qx{$command}; dd $line;

If I knew awk, I'd still recommend converting it to perl using a2p