grep "^\[bugID[[:digit:]]\{1,\}\]"は一行目用です。またはどうすればいいgrepですbugID か TICKET-
[bugID12345] fix for performance issue
[TICKET-12345] fix for memory leak issue
[bugID23244] fix for performance issue
[TICKET-54678] fix for memory leak issue
egrepエスケープ|も必要な代替をサポートします。[
egrep "^\[(bugID|TICKET-)[[:digit:]]{1,}\]" file
[bugID12345] fix for performance issue
[TICKET-12345] fix for memory leak issue
[bugID23244] fix for performance issue
[TICKET-54678] fix for memory leak issue
行全体が必要ない場合は、次の-oオプションを使用します。
egrep -o "^\[(bugID|TICKET-)[[:digit:]]{1,}\]" file
[bugID12345]
[TICKET-12345]
[bugID23244]
[TICKET-54678]