Use AWK Like this:
cat /var/log/maillog | awk '{ if ($1=="May" && $2=="7") print $0 }' | grep NOQUEUE Newton Pasqualini Filho newtonpasqual...@gmail.com Em 07/05/2013, às 11:03, Reindl Harald <h.rei...@thelounge.net> escreveu: > Hi > > i would like a grep of all records from the previous > day with "NOQUEUE" in a bash script - how do i get > exactly the format like below from /var/log/maillog > and yesterday? > > May 7 12:29:39 mail postfix/smtpd[29696]: NOQUEUE > > final goal: > add the output at the bottom a my daily logwatch >