【发布时间】:2016-10-20 19:10:01
【问题描述】:
使用 bash 我输入我的年月日,并需要检查文本文件是否包含该特定日期,如果是,我需要返回文本文件名。
例如:
ThreadNum: 309264
Subject: Re: math
To: aaaa1425@aol.com (aaa)
From: Doctor Douglas
TimeStamp: 03/08/2004 at 13:58:57
Sent: yes
如果我的输入与时间戳匹配,我需要打印出文件名。如何使用 bash 匹配时间戳?
【问题讨论】:
-
错误
grep -l date files? -
grep -lIR 'TimeStamp: 03/08/2004' /directory/with/files/