#!/bin/sed -nrf # TS: \([0-9]\): /([0-9]+): >>> emerge \([^)]+\) ([^ ]+) to .*/ { s/([0-9]+): >>> emerge \([^)]+\) ([^ ]+) to .*/\1\temerge-start\t\2/ p; n; } /([0-9]+): ::: completed emerge \([^)]+\) ([^ ]+) to .*/ { s/([0-9]+): ::: completed emerge \([^)]+\) ([^ ]+) to .*/\1\temerge-finish\t\2/ p; n; } /([0-9]+): === Unmerging... \(([^ )]+)\)/ { s/([0-9]+): === Unmerging... \(([^ )]+)\)/\1\tunmerge-start\t\2/ p; n; } /([0-9]+): >>> unmerge success: (.*)/ { s/([0-9]+): >>> unmerge success: (.*)/\1\tunmerge-finish\t\2/ p; n; } /([0-9]+): Started emerge on:.*/ { s/([0-9]+): Started emerge on:.*/\1\tprogram-start/ p; n; } /([0-9]+): \*\*\* exiting unsuccessfully with status '([^']+)'.*/ { s/([0-9]+): \*\*\* exiting unsuccessfully with status '([^']+)'.*/\1\tprogram-exit\t\2/ p; n; } /([0-9]+): \*\*\* exiting successfully.*/ { s/([0-9]+): \*\*\* exiting successfully.*/\1\tprogram-exit\t0/ p; n; }