in reply to Re^2: Join lines that match an string
in thread Join lines that match an string
Right, unlike the other solutions, that one joins the line with the terminator and the next one. You could write
but that's a bit ugly, or decide that the flip-flop shortcut isn't appropriate in such case and track the flag by hand, such asperl -wpe 'if ((/\bremotely\b/.../\bp_args\b/) !~ /^$|E0/) { chomp }' +a
perl -wpe 'if (($_f ||= /\bremotely\b/) &&= !/\bp_args\b/) { chomp }' +a
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Join lines that match an string
by ranrodrig (Novice) on Jul 13, 2010 at 20:00 UTC | |
by ambrus (Abbot) on Jul 13, 2010 at 20:08 UTC |