cat "file.log"| grep -q '2013-11-10'
while read line
do
echo file_content_time=`echo $line | sed -e 's/\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0- 9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\).*/\1/'`
if [ $? -eq 0 ]
then
echo comparison_start_date=`date -d "$file_content_time" +%Y%m%d`
fi
done < 'file.log'/*在这里,我正在尝试找出包含'2013-11-10‘的行,从那行开始,必须显示日期。
发布于 2014-01-27 09:59:51
initial_time=$(grep -o -m1 "2013-11-10 -90-90-9“file.log)
发布于 2014-01-13 07:47:30
若要输出从包含模式的行到文件末尾的所有内容,只需
awk '/2013-11-10/,/pattern-not-in-file/' file.log发布于 2014-01-13 07:54:54
awk '/pattern/{p=1}p' your_filehttps://stackoverflow.com/questions/21085965
复制相似问题