ログ ファイルの正確なクエリを実行しようとしています (つまり、過去 30 日間のすべてのバウンス)。
2 つの要素が欠落しているようです。stdin が zcat 情報を取得するとは思わず、変数を awk に渡す際にもエラーがあると思います。
home # lastDate=$(date -d "last month" 2>&1 {$1, $2, $3}) | cat /var/log/messages | zcat /var/log/messages-* | awk '$0>=from&&$0<=to' from='{ print date +"%m-%d"}' to=$lastDate '{print to}' | grep -i reject
awk: fatal: cannot open file `{print to}' for reading (No such file or directory)
壊れた場所:
lastDate=$(date -d "last month" 2>&1 {$1, $2, $3})|awk '{print lastDate}'
no error, no output
date -d "先月" Fri Jul 26 07:13:40 UTC 2013