Using OR and command substitution
The following开发者_如何学运维 command works as expected...
tail /var/log/mysqld.log | grep `date '+%y%m%d' --date='1 day ago'`
But this does not...
tail /var/log/mysqld.log | grep (`date '+%y%m%d' --date='1 day ago'` | `date '+%y%m%d'`)
I want to return the lines having yesterday OR today.
tail /var/log/mysqld.log | grep -e `date '+%y%m%d' --date='1 day ago'` -e `date '+%y%m%d'`
精彩评论