开发者

Using OR and command substitution

开发者 https://www.devze.com 2023-03-05 04:47 出处:网络
The following开发者_如何学运维 command works as expected... tail /var/log/mysqld.log | grep `date \'+%y%m%d\' --date=\'1 day ago\'`

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'`
0

精彩评论

暂无评论...
验证码 换一张
取 消