interpolation is interpolation, in shell, in awk, in perl -- that is right, you've got three four levels of interpolation in there (quite nuts by my standards)
use strict; use warnings; use Data::Dump; my $line= qq{awk -v start="$(date -d '10 mins ago' +'%b %e %T')" -v e +nd="$(date +'%b %e %T')" '{tm=$1" "$2" "$3}; star t<tm&&tm<end' /d/d1/logs/stdout-1132.txt}; dd $line; __END__ Use of uninitialized value $1 in concatenation (.) or string at - line + 3. Use of uninitialized value $2 in concatenation (.) or string at - line + 3. Use of uninitialized value $3 in concatenation (.) or string at - line + 3. "awk -v start=\"0date -d '10 mins ago' +'%b %e %T')\" -v end=\"0date ++'%b %e %T')\" '{tm=\" \"\" \"}; start<tm&&tm<end' /d/d1/logs/stdout +-1132.txt"
So, not being interested in debugging your shell or awk , I thought I'd just point out the perl errors
Read perlintro and employ some single quotes
In reply to Re: grep lines from log for last 10 mints
by Anonymous Monk
in thread grep lines from log for last 10 mints
by bimleshsharma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |