On Fri Jul 22 16:00:05 2016, aristotle wrote: > * Tony Cook via RT <perlbug-followup@perl.org> [2016-07-22 06:12]: > > - $sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule > > \2|" .deptmp \ > > - >>$mf.new > > + $sed -n -e 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; > > '"$defrule \2|" -e p \ > > + -e '/^miniperlmain/{' -e 's/mini//' -e p -e '}' \ > > + .deptmp >>$mf.new > > You can combine -e p -e '/^miniperlmain/{' -e 's/mini//' -e p > -e '}' > into -e 'p; /^miniperlmain/{ s/mini//; p; }' > > If you reverse order inside the block you can drop the `-n` switch and > one explicit `p`: > -e '/^miniperlmain/{ p; s/mini// }' > > If it’s acceptable to reverse the order of lines for that case, then > you > can also avoid the repeated pattern match by using the `/p` flag and > the > hold space: > -e 'h; s/mini\(perlmain\)/\1/p; g' > > In total: > > $sed -e 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" > \ > -e 'h; s/mini\(perlmain\)/\1/p; g' \ > .deptmp >>$mf.new Thanks, applied as d58d97f6763c77718dffaa4394087658d7401361 Tony --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=128685