0
我想從文件中grep某些模式並列出它,但grep命令工作不一致。
對於其中一個模式的工作和其他不工作。請讓我知道如果我錯過什麼:gegrep命令工作不一致
文件到grep
=============================================================================================================================== START_TIME END_TIME CLIENT_NAME STATUS BACKUP_TYPEPOLICY_NAME =============================================================================================================================== 2015-12-09 01:51:35 2015-12-09 02:11:47 atrcxb1144-bup3 success FULL atrcxb1144-bup3_FILES 2015-12-09 02:13:06 2015-12-09 02:14:12 atrcxb1144-bup3 success FULL atrcxb1144-bup3_Hot_Catalog 2015-12-15 08:17:48 2015-12-15 08:18:55 atrcxb1144-bup3 success FULL atrcxb1144-bup3_Hot_Catalog 2016-01-23 23:55:00 2016-01-24 00:17:03 cbtcnbgrn2eniqs2-bkup success FULL ENIQ_STATS_ROOT_cbtcnbgrn2eniqs2-bkup
不成功
bash-3.2# /usr/sfw/bin/gegrep '([[:blank:]]+success[[:blank:]]+[FI][UN][LC][LR][[:blank:]]+ENIQ_STATS_ROOT_cbtcnbgrn2eniqs2-bkup[[:blank:]]+)' /usr/openv/netbackup/db/.backup_history
bash-3.2# echo $?
1
成功
bash-3.2# /usr/sfw/bin/gegrep '([[:blank:]]+success[[:blank:]]+[FI][UN][LC][LR][[:blank:]]+ENIQ_STATS_ONBLADE_RAW_cbtcnbgrn2eniqs2-bkup[[:blank:]]+)' /usr/openv/netbackup/db/.backup_history
2016-01-23 23:55:00 2016-01-24 00:17:03 cbtcnbgrn2eniqs2-bkup success FULL ENIQ_STATS_ONBLADE_RAW_cbtcnbgrn2eniqs2-bkup
bash-3.2# echo $?
0